I have given a project which works ok on other PCs but on mine it doesnt work.
When I hit build, it reports in node logs error missing script: build
Steps that I've done
installed nodejs
installed gulp globally and locally (inside of mvc project)
*Warning: I have different versions of nodejs and gulp then it specified in solution.
here is the package.json:
{
"name": "test",
"version": "1.0.0",
"private": true,
"scripts": {
"css": "gulp"
},
"engines": {
"node": "5.9.1",
"npm": "3.7.3"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-less": "^3.1.0",
"gulp-minify-css": "^1.2.4",
"gulp-sourcemaps": "^2.3.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.7",
"merge-stream": "^1.0.0"
}
}
so when I hit command npm run gulp it says that gulp script doesnt found - expected.
but when I hit npm run css Im gettin an error:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'css'
1 verbose cli ]
2 info using npm#6.13.1
3 info using node#v13.3.0
4 verbose run-script [ 'precss', 'css', 'postcss' ]
5 info lifecycle tiptimes#1.0.0~precss: tiptimes#1.0.0
6 info lifecycle tiptimes#1.0.0~css: tiptimes#1.0.0
7 verbose lifecycle tiptimes#1.0.0~css: unsafe-perm in lifecycle true
8 verbose lifecycle tiptimes#1.0.0~css: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Work\tiptimes\MvcApplication\node_modules\.bin;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Program Files\Seq\;C:\Program Files\Seq\Client\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files (x86)\dotnet\;C:\Users\Stefan Cvetkovic\AppData\Local\Microsoft\WindowsApps;C:\Users\Stefan Cvetkovic\.dotnet\tools;C:\Program Files (x86)\Rico Suter\NSwagStudio\;C:\Users\Stefan Cvetkovic\AppData\Roaming\npm;C:\Users\Stefan Cvetkovic\.dotnet\tools
9 verbose lifecycle tiptimes#1.0.0~css: CWD: C:\Work\tiptimes\MvcApplication
10 silly lifecycle tiptimes#1.0.0~css: Args: [ '/d /s /c', 'gulp' ]
11 silly lifecycle tiptimes#1.0.0~css: Returned: code: 1 signal: null
12 info lifecycle tiptimes#1.0.0~css: Failed to exec css script
13 verbose stack Error: tiptimes#1.0.0 css: `gulp`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:219:5)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:219:5)
13 verbose stack at maybeClose (internal/child_process.js:1027:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:5)
14 verbose pkgid tiptimes#1.0.0
15 verbose cwd C:\Work\tiptimes\MvcApplication
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "css"
18 verbose node v13.3.0
19 verbose npm v6.13.1
20 error code ELIFECYCLE
21 error errno 1
22 error tiptimes#1.0.0 css: `gulp`
22 error Exit status 1
23 error Failed at the tiptimes#1.0.0 css script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Here are my files in the root of MVCApp
https://i.imgur.com/QOo2OLE.png
Im using vs2017
Any help would be appreciated!
Since it works on other PC, double check their nodejs version and make sur it matches yours.
Also, you either want to run gulp directly (gulp yourGulpTask) or add node script within package.json and run them with npm. Ex (add scripts node in your package.json file):
"scripts": {
"build": "gulp build",
"test": "gulp test",
"watch": "gulp watch",
},
With the previous scripts declaration, if the the gulp task build, test and watch are define within the gulp.js file, you could run the following :
npm run build
npm run test
npm run watch
When gulp is ran without arguments, it is trying to run the default task. In your case, the css script is calling gulp without argument, therefore calling the default gulp task([ 'precss', 'css', 'postcss' ]).
To debug, make sure you can run these gulp-tasks independently
gulp precss
gulp css
gulp postcss
It feels like your precss works fine. Your css task is bugging and we never get to postcss.
The meaningfull error on your log is this one :
verbose lifecycle tiptimes#1.0.0~css: unsafe-perm in lifecycle true
Most likey confirming the nodejs version issue :: npm run test - unsafe-perm in lifecycle
On a quick note, running npm run gulp would be weird. Should always give meaningfull name to your scripts... Gulp.js conventions for tasks names
Related
The full stack trace here:
https://pastebin.com/4sPgfuee
But a couple snippets:
TypeError: Cannot read properties of null (reading 'useContext')
at Object.exports.useContext (/tmp/build_758b0112/frontend/node_modules/react/cjs/react.production.min.js:24:118)
at Head (/tmp/build_758b0112/frontend/node_modules/next/dist/shared/lib/head.js:202:34)
at Wc (/tmp/build_758b0112/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
at Object.exports.useContext (/tmp/build_758b0112/frontend/node_modules/react/cjs/react.production.min.js:24:118)
at Head (/tmp/build_758b0112/frontend/node_modules/next/dist/shared/lib/head.js:202:34)
Does anyone know what this error means? I don't use useContext anywhere in my code. I was told it was an issue with the Image and Head tags in Next JS, and so I swapped them for and tags in my code respectively and got the same errors. I removed react-dom as one of my dependencies and it still gives this error. The project works on my local machine no problem. How do I get rid of this error?
Thinking about it a bit more, admittedly, the frontend folder I want to deploy to github isn't in the root of my project. But I found a work around where I have a copy of node_modules/ and my package.json file in the root where the package.json file is identical to the one in my front end except for this small feature:
EDIT: adjusted for full package.json
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"engines": {
"node": "17.x",
"npm": "8.x"
},
"scripts": {
"dev": "next dev",
"build": "cd frontend ; next build",
"start": "next start",
"lint": "next lint"
},
"devDependencies": {
"bulma": "^0.9.4",
"eslint": "8.15.0",
"eslint-config-next": "12.1.6",
"ethers": "^5.6.9",
"fs": "^0.0.1-security",
"next": "^12.2.3",
"react": "^18.2.0",
"solc": "^0.8.15",
"web3": "^1.7.4",
"web3-utils": "^1.7.4"
}
}
Within my scripts section, I inserted the cd frontend command to get to the frontend folder to build the project. Could this have backfired on me?
EDIT: When I run npm run build on my machine from the frontend folder, I get
:frontend$ npm run build
> frontend#0.1.0 build
> next build
info - Loaded env from ~/Project/frontend/.env.local
./pages/ResplendentCard.js
39:22 Warning: Do not use <img>. Use Image from 'next/image' instead. See: https://nextjs.org/docs/messages/no-img-element #next/next/no-img-element
39:22 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info - Linting and checking validity of types
(node:33657) [DEP_WEBPACK_MODULE_UPDATE_HASH] DeprecationWarning: Module.updateHash: Use new ChunkGraph API
(Use `node --trace-deprecation ...` to show where the warning was created)
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data
info - Generating static pages (5/5)
info - Finalizing page optimization
Page Size First Load JS
┌ ○ / 5.76 kB 83.3 kB
├ └ css/149b18973e5508c7.css 655 B
├ /_app 0 B 77.6 kB
├ ○ /404 195 B 77.8 kB
├ λ /api/hello 0 B 77.6 kB
├ ○ /resplendent (480 ms) 4.59 kB 875 kB
├ ├ css/0de6f3d7089795f1.css 27.4 kB
├ └ css/0a7d2580efac90af.css 202 B
└ ○ /ResplendentCard (436 ms) 217 B 870 kB
+ First Load JS shared by all 77.6 kB
├ chunks/framework-45405dbdcddf505d.js 45.3 kB
├ chunks/main-43f32a18558cfd50.js 30.9 kB
├ chunks/pages/_app-8027895d08fe9881.js 510 B
├ chunks/webpack-f9a9a24bf6cd9a1b.js 897 B
└ css/179c343107565a9c.css 478 B
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
○ (Static) automatically rendered as static HTML (uses no initial props)
I assume this means it works. Yet when I run the build command from my root folder:
> frontend#0.1.0 build
> cd frontend ; next build
info - Loaded env from ~Project/frontend/.env.local
./pages/ResplendentCard.js
39:22 Warning: Do not use <img>. Use Image from 'next/image' instead. See: https://nextjs.org/docs/messages/no-img-element #next/next/no-img-element
39:22 Warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images. jsx-a11y/alt-text
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info - Linting and checking validity of types
(node:33746) [DEP_WEBPACK_MODULE_UPDATE_HASH] DeprecationWarning: Module.updateHash: Use new ChunkGraph API
(Use `node --trace-deprecation ...` to show where the warning was created)
info - Creating an optimized production build
info - Compiled successfully
info - Collecting page data ...node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
Error: Cannot find module '../frontend/node_modules/next/dist/shared/lib/constants.js'
Require stack:
- ~Project/frontend/.next/server/pages/_document.js
- ~Project/node_modules/next/dist/server/require.js
- ~Project/node_modules/next/dist/server/load-components.js
- ~Project/node_modules/next/dist/build/utils.js
- ~Project/node_modules/next/dist/build/worker.js
- ~Project/node_modules/next/dist/compiled/jest-worker/processChild.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.221 (~Project/frontend/.next/server/pages/_document.js:32:18)
at __webpack_require__ (~Project/frontend/.next/server/webpack-runtime.js:25:42)
at Object.105 (~Project/frontend/.next/server/chunks/105.js:375:18)
at __webpack_require__ (~Project/frontend/.next/server/webpack-runtime.js:25:42)
at __webpack_exec__ (~Project/frontend/.next/server/pages/_document.js:70:39)
at ~~Project/frontend/.next/server/pages/_document.js:71:70 {
type: 'Error',
code: 'MODULE_NOT_FOUND',
requireStack: [
'~Project/frontend/.next/server/pages/_document.js',
'~Project/node_modules/next/dist/server/require.js',
'~Project/node_modules/next/dist/server/load-components.js',
'~Project/node_modules/next/dist/build/utils.js',
'~Project/node_modules/next/dist/build/worker.js',
'~Project/node_modules/next/dist/compiled/jest-worker/processChild.js'
]
}
Node.js v17.2.0
I follow the installation instructions for Apache Flink on github:
git clone https://github.com/apache/flink.git
cd flink
mvn clean package -DskipTests # this will take up to 10 minutes
Tough the maven build takes much longer than "up to 10 minutes" and fails with
[ERROR] Failed to execute goal
com.github.eirslett:frontend-maven-plugin:1.11.0:npm (npm run
ci-check) on project flink-runtime-web: Failed to run task: 'npm run
ci-check' failed. org.apache.commons.exec.ExecuteException: Process
exited with an error
Log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\hdp\flink\flink-runtime-web\web-dashboard\node\node.exe',
1 verbose cli 'C:\hdp\flink\flink-runtime-web\web-dashboard\node\node_modules \npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'ci-check'
1 verbose cli ]
2 info using npm#6.13.4
3 info using node#v12.14.1
4 verbose run-script [ 'preci-check', 'ci-check', 'postci-check' ]
5 info lifecycle flink-dashboard#2.0.0~preci-check: flink-dashboard#2.0.0
6 info lifecycle flink-dashboard#2.0.0~ci-check: flink-dashboard#2.0.0
7 verbose lifecycle flink-dashboard#2.0.0~ci-check: unsafe-perm in lifecycle true
8 verbose lifecycle flink-dashboard#2.0.0~ci-check: PATH: C:\hdp\flink\flink-runtime-web\web-dashboard\node\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\hdp\flink\flink-runtime-web\web-dashboard\node_modules.bin;C:\hdp\flink\flink-runtime-web\web-dashboard\node;C:\Users\julia\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\julia\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\GnuPG\bin;C:\Program Files\Git\cmd;C:\Program Files\CMake\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\nodejs;C:\protoc\bin;C:\Program Files\Maven\apache-maven-3.8.4\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\GnuPG\bin;C:\Program Files\Git\cmd;C:\Program Files\CMake\bin;C:\Users\julia\anaconda3;C:\Users\julia\anaconda3\Scripts;C:\hdp\hadoop-3.3.0\bin;C:\Program Files\Java\jdk-17.0.1;C:\hdp\hadoop-3.3.0\sbin;C:\hdp\spark-3.0.3-bin-hadoop3.2\bin;C:\Users\julia\AppData\Local\Coursier\data\bin;C:\hdp\spark-3.0.3-bin-hadoop3.2\python;C:\hdp\flink-1.14.2\bin;C:\Users\julia\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;
9 verbose lifecycle flink-dashboard#2.0.0~ci-check: CWD: C:\hdp\flink\flink-runtime-web\web-dashboard
10 silly lifecycle flink-dashboard#2.0.0~ci-check: Args: [ '/d /s /c', 'npm run lint && npm run build' ]
11 silly lifecycle flink-dashboard#2.0.0~ci-check: Returned: code: 1 signal: null
12 info lifecycle flink-dashboard#2.0.0~ci-check: Failed to exec ci-check script
13 verbose stack Error: flink-dashboard#2.0.0 ci-check: npm run lint && npm run build
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\hdp\flink\flink-runtime-web\web-dashboard\node\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:223:5)
13 verbose stack at ChildProcess. (C:\hdp\flink\flink-runtime-web\web-dashboard\node\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:223:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid flink-dashboard#2.0.0
15 verbose cwd C:\hdp\flink\flink-runtime-web\web-dashboard
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\hdp\flink\flink-runtime-web\web-dashboard\node\node.exe" "C:\hdp\flink\flink-runtime-web\web-dashboard\node\node_modules\npm\bin\npm-cli.js" "run" "ci-check"
18 verbose node v12.14.1
19 verbose npm v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error flink-dashboard#2.0.0 ci-check: npm run lint && npm run build
22 error Exit status 1
23 error Failed at the flink-dashboard#2.0.0 ci-check script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Do you have NPM installed already on your machine? This errors usually is encountered when there's a problem with a local NPM installation that prevents the Flink web interface from building. If you don't need this, you could consider skipping it by running mvn clean package -DskipTests -Pskip-webui-build
I have an NS 6.3.0 Core app on a windows 10 machine. When I try to build the cli gets stuck. Here are the details:
PS C:\DEV PROJECTS\DRAX\Project\wa_app> tns build android
Copying template files...
Platform android successfully added. v6.3.1
Preparing project...
Starting type checking service...
Using 1 worker with 4096MB memory limit
I have left it there for 90 minutes without any additional activity. Here is the output if I use --log trace:
Looking for project in 'C:\DEV PROJECTS\DRAX\Project\wa_app'
Project directory is 'C:\DEV PROJECTS\DRAX\Project\wa_app'.
Loading extensions.
System information:
{
"platform": "win32",
"shell": "C:\\WINDOWS\\system32\\cmd.exe",
"os": "Windows 10 Pro 6.3.18362",
"procArch": "x64",
"nodeVer": "12.6.0",
"npmVer": "6.9.0",
"nodeGypVer": null,
"nativeScriptCliVersion": "6.3.0",
"gitVer": "2.15.1.windows.2",
"dotNetVer": "4.8.03752",
"javacVersion": "1.8.0_172",
"javaVersion": "1.8.0_172",
"javaPath": "C:\\Program Files\\Java\\jdk1.8.0_172\\bin\\java.exe",
"adbVer": "1.0.41",
"androidInstalled": true,
"monoVer": null,
"gradleVer": null,
"isAndroidSdkConfiguredCorrectly": true,
"xcodeprojLocation": null,
"itunesInstalled": false,
"isCocoaPodsWorkingCorrectly": false,
"isCocoaPodsUpdateRequired": false,
"pythonInfo": null
}
Current CLI version: 6.3.0
Starting watch on killswitch C:\Users\Daniel\AppData\Local\Temp\Daniel\KillSwitches\cli
Trying to handle SIGINT event. CLI overrides this behavior and does not allow handling SIGINT as this causes issues with Ctrl + C in terminal.
The stackTrace of the location trying to handle SIGINT is:
at process.on (C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\lib\nativescript-cli.js:24:28)
at C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\node_modules\signal-exit\index.js:122:15
at Array.filter (<anonymous>)
at load (C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\node_modules\signal-exit\index.js:120:21)
at module.exports (C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\node_modules\signal-exit\index.js:35:5)
at Object.<anonymous> (C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\node_modules\proper-lockfile\lib\lockfile.js:296:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\node_modules\proper-lockfile\index.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
spawn: C:\Program Files\nodejs\node.exe "C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\lib\detached-processes\cleanup-process.js" "C:\Users\Daniel\AppData\Roaming\npm\node_modules\nativescript\lib\bootstrap.js"
Shasum of file C:\DEV PROJECTS\DRAX\Project\wa_app\package.json is b3aed19d4e097a799102ec94894a2a7b24e4c758
Got cached result for shouldMigrate for platform: Android
Initializing analytics statuses.
Analytics statuses: { TrackFeatureUsage: 'disabled', TrackExceptions: 'disabled' }
getInfos cacheConfig options: { forceCheck: undefined } current info from cache: [
{
message: 'Your ANDROID_HOME environment variable is set and points to correct directory.',
platforms: [ 'Android' ],
type: 'info'
},
{
message: 'Your adb from the Android SDK is correctly installed.',
platforms: [ 'Android' ],
type: 'info'
},
{
message: 'The Android SDK is installed.',
platforms: [ 'Android' ],
type: 'info'
},
{
message: 'A compatible Android SDK for compilation is found.',
platforms: [ 'Android' ],
type: 'info'
},
{
message: 'Javac is installed and is configured properly.',
platforms: [ 'Android' ],
type: 'info'
},
{
message: 'The Java Development Kit (JDK) is installed and is configured properly.',
platforms: [ 'Android' ],
type: 'info'
},
{
message: 'Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.',
additionalInformation: '',
platforms: [ 'iOS' ],
type: 'info'
}
]
Your ANDROID_HOME environment variable is set and points to correct directory.
Your adb from the Android SDK is correctly installed.
The Android SDK is installed.
A compatible Android SDK for compilation is found.
Javac is installed and is configured properly.
The Java Development Kit (JDK) is installed and is configured properly.
Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
Selected targetSdk is: 28
Installed Android Targets are: [ 'android-25', 'android-26', 'android-28' ]
Selected buildToolsVersion is: 28.0.3
Validate options for platform: Android
Project dir from hooksArgs is: C:\DEV PROJECTS\DRAX\Project\wa_app.
Hooks directories: [ 'C:\\DEV PROJECTS\\DRAX\\Project\\wa_app\\hooks' ]
BeforeHookName for command prepare is before-prepare
Preparing project...
spawn: C:\Program Files\nodejs\node.exe "--max_old_space_size=4096" "--preserve-symlinks" "C:\DEV PROJECTS\DRAX\Project\wa_app\node_modules\webpack\bin\webpack.js" "--config=C:\DEV PROJECTS\DRAX\Project\wa_app\webpack.config.js" "--env.android" "--env.appPath=app" "--env.appResourcesPath=app\App_Resources" "--env.verbose" "--env.sourceMap"
clean-webpack-plugin: C:\DEV PROJECTS\DRAX\Project\wa_app\platforms\android\app\src\main\assets\app\**\* has been removed.
clean-webpack-plugin: C:\DEV PROJECTS\DRAX\Project\wa_app\platforms\android\app\src\main\assets\snapshots has been removed.
clean-webpack-plugin: C:\DEV PROJECTS\DRAX\Project\wa_app\platforms\android\app\build\configurations\nativescript-android-snapshot has been removed.
Starting type checking service...
Using 1 worker with 4096MB memory limit
The CLI also hangs on tns run command with:
C:\DEV PROJECTS\DRAX\Project\wa_app>tns run android
Searching for devices...
Preparing project...
File change detected. Starting incremental webpack compilation...
Starting type checking service...
Using 1 worker with 4096MB memory limit
webpack is watching the files…
I have tried removing nativescript, restarting my machine, restarting VS Code with no results. The same happens if I try to use SideKick.
Any ideas on how to get past this?
Thanks
After some testing, I narrowed it down to the https://www.npmjs.com/package/nativescript-contacts plugin. I do not know what the reason is, but as soon as I uninstalled it, everything worked as expected.
I've had a Nightwatch project running on a daily timer testing my site. I have a log file that I check every few weeks to make sure everything is going smoothly. Today I noticed it's been running, but crashing after a couple seconds of running (it usually takes half an hour to do everything).
I haven't changed the code, updated any of the packages or node, or purposefully changed anything else on my computer in the past week.
I placed a lot of logging calls in my code (I had to use my fs logger because console.log is not showing up after the process runs like it normally does). It doesn't always quit at the same point through the code, so I figured it was a Nightwatch problem and not mine.
I created a simple test file I could use to see if my complicated tests were messing things up. It prints the logs to my file, but doesn't run any of the tests and the browser pops up for less than a second before the whole thing crashes.
Current test:
const fs = require('fs');
module.exports = {
'#tags': ['getDistricts'],
'Get Districts Assert Title': function (browser) {
fs.appendFile("./log.txt", "\nBROWSER: " + JSON.stringify(browser), function (err) { });
browser.pause(100000); //prevent method from ending before tickets are retrieved
fs.appendFile("./log.txt", "\nNew run: " + new Date(), function (err) { });
browser
.url('https://www.google.com')
.waitForElementVisible('body')
.assert.title('Google')
fs.appendFile("./log.txt", "\nRan tests", function (err) { });
}
};
Log file:
BROWSER: {"capabilities":{},"globals":{"waitForConditionTimeout":15000},"sessionId":null,"options":{"screenshots":true,"screenshotsPath":"./node_modules/nightwatch/screenshots/","skip_testcases_on_fail":true,"log_screenshot_data":true,"username":"${SAUCE_USERNAME}","accessKey":"${SAUCE_ACCESS_KEY}","desiredCapabilities":{"browserName":"chrome","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","chromeOptions":{"args":["Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46\n (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3","--window-size=640,1136"]},"name":"Temp Test"}},"launchUrl":"http://localhost","launch_url":"http://localhost","screenshotsPath":"./node_modules/nightwatch/screenshots/","Keys":{"NULL":"","CANCEL":"","HELP":"","BACK_SPACE":"","TAB":"","CLEAR":"","RETURN":"","ENTER":"","SHIFT":"","CONTROL":"","ALT":"","PAUSE":"","ESCAPE":"","SPACE":"","PAGEUP":"","PAGEDOWN":"","END":"","HOME":"","LEFT_ARROW":"","UP_ARROW":"","RIGHT_ARROW":"","DOWN_ARROW":"","ARROW_LEFT":"","ARROW_UP":"","ARROW_RIGHT":"","ARROW_DOWN":"","INSERT":"","DELETE":"","SEMICOLON":"","EQUALS":"","NUMPAD0":"","NUMPAD1":"","NUMPAD2":"","NUMPAD3":"","NUMPAD4":"","NUMPAD5":"","NUMPAD6":"","NUMPAD7":"","NUMPAD8":"","NUMPAD9":"","MULTIPLY":"","ADD":"","SEPARATOR":"","SUBTRACT":"","DECIMAL":"","DIVIDE":"","F1":"","F2":"","F3":"","F4":"","F5":"","F6":"","F7":"","F8":"","F9":"","F10":"","F11":"","F12":"","COMMAND":"","META":""},"expect":{},"assert":{},"verify":{},"currentEnv":"tempTest_1","currentTest":{"name":"Get Districts Assert Title","module":"tempTest","results":{"steps":[],"passed":0,"failed":0,"errors":0,"skipped":0,"tests":0,"testcases":{},"timestamp":"Thu, 22 Aug 2019 18:50:31 GMT","time":0},"group":""}}
New run: Thu Aug 22 2019 13:50:31 GMT-0500 (Central Daylight Time)
Ran tests
npm test --verbose:
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'test',
npm verb cli '--verbose' ]
npm info using npm#6.9.0
npm info using node#v10.16.0
npm verb run-script [ 'pretest', 'test', 'posttest' ]
npm info lifecycle artms-nightwatch#1.0.24~pretest: artms-nightwatch#1.0.24
npm info lifecycle artms-nightwatch#1.0.24~test: artms-nightwatch#1.0.24
> artms-nightwatch#1.0.24 test C:\Users\malai\Nightwatch
> nightwatch --env local
Starting selenium server in parallel mode... started - PID: 23680
Started child process for: tempTest
>> tempTest finished.
npm verb lifecycle artms-nightwatch#1.0.24~test: unsafe-perm in lifecycle true
npm verb lifecycle artms-nightwatch#1.0.24~test: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\malai\Nightwatch\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\dotnet\;C:\Program Files (x86)\dotnet\;C:\Users\malai\AppData\Local\Microsoft\WindowsApps;C:\Users\malai\AppData\Roaming\npm;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\malai\.dotnet\tools
npm verb lifecycle artms-nightwatch#1.0.24~test: CWD: C:\Users\malai\Nightwatch
npm info lifecycle artms-nightwatch#1.0.24~test: Failed to exec test script
npm ERR! Test failed. See above for more details.
npm verb exit [ 1, true ]
npm timing npm Completed in 4145ms
npm verb code 1
I was never able to figure out why it stopped working, but I started from scratch and rebuilt the project on the most recent version of Nightwatch and copied my tests over and it's working again.
please help with this build problem. i have checked system variables. they are correct like priyank mentioned in other answers
Warning 1 The TypeScript Compiler was given no files for compilation, so it will skip compiling. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets 90 5 SampleHybridApp
Error 2 Cannot find module 'config-chain' Z:\VSProject\Projects\SampleHybridApp\SampleHybridApp\EXEC 1 1 SampleHybridApp
Error 3 The command ""C:\Users\Vishal Dwivedi\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Android" --configuration "Debug" --projectDir . --projectName "SampleHybridApp" --buildServerUrl "" --buildTarget "AndroidEmulator"" exited with code 8. C:\Users\Vishal Dwivedi\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 68 5 SampleHybridApp