I am trying to built a MEAN Todo app by following https://github.com/michaelcheng429/super-mean-stack
package.json
{
"name": "ToDoThoughts",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "NODE_PATH=$NODE_PATH:./app node server",
"dev": "npm start & webpack-dev-server --progress --colors"
},
"license": "ISC",
"dependencies": {
"angular": "1.4.12",
"angular-ui-router": "0.3.1",
"body-parser": "1.15.2",
"bootstrap": "3.3.7",
"express": "4.14.0"
},
"devDependencies": {
"babel-core": "6.17.0",
"babel-preset-es2015": "6.16.0",
"raw-loader": "0.5.1",
"webpack": "1.13.2",
"webpack-dev-server": "1.16.2"
},
"engines": {
"node": "5.5.0"
}
}
I am getting error when i run the command "npm run dev" in the command prompt.
I have also attached npm.debug.log
> ToDoThoughts#1.0.0 start C:\Projects\ToDoThoughts
> NODE_PATH=$NODE_PATH:./app node server
'NODE_PATH' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Selva\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.5.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ToDoThoughts#1.0.0 start: `NODE_PATH=$NODE_PATH:./app node server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ToDoThoughts#1.0.0 start script 'NODE_PATH=$NODE_PATH:./app node server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ToDoThoughts package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! NODE_PATH=$NODE_PATH:./app node server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ToDoThoughts
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ToDoThoughts
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Projects\ToDoThoughts\npm-debug.log
npm.debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Selva\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#3.10.8
3 info using node#v6.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ToDoThoughts#1.0.0~prestart: ToDoThoughts#1.0.0
6 silly lifecycle ToDoThoughts#1.0.0~prestart: no script for prestart, continuing
7 info lifecycle ToDoThoughts#1.0.0~start: ToDoThoughts#1.0.0
8 verbose lifecycle ToDoThoughts#1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle ToDoThoughts#1.0.0~start: PATH: C:\Users\Selva\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Projects\ToDoThoughts\node_modules\.bin;C:\Users\Selva\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Projects\ToDoThoughts\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Skype\Phone\;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\Selva\AppData\Local\Microsoft\WindowsApps;C:\Users\Selva\AppData\Roaming\npm;C:\Users\Selva\AppData\Local\atom\bin;C:\Program Files\Git\bin;C:\Projects\ToDoThoughts
10 verbose lifecycle ToDoThoughts#1.0.0~start: CWD: C:\Projects\ToDoThoughts
11 silly lifecycle ToDoThoughts#1.0.0~start: Args: [ '/d /s /c', 'NODE_PATH=$NODE_PATH:./app node server' ]
12 silly lifecycle ToDoThoughts#1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle ToDoThoughts#1.0.0~start: Failed to exec start script
14 verbose stack Error: ToDoThoughts#1.0.0 start: `NODE_PATH=$NODE_PATH:./app node server`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Users\Selva\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\Selva\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:877:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid ToDoThoughts#1.0.0
16 verbose cwd C:\Projects\ToDoThoughts
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Selva\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
19 error node v6.5.0
20 error npm v3.10.8
21 error code ELIFECYCLE
22 error ToDoThoughts#1.0.0 start: `NODE_PATH=$NODE_PATH:./app node server`
22 error Exit status 1
23 error Failed at the ToDoThoughts#1.0.0 start script 'NODE_PATH=$NODE_PATH:./app node server'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the ToDoThoughts package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error NODE_PATH=$NODE_PATH:./app node server
23 error You can get information on how to open an issue for this project with:
23 error npm bugs ToDoThoughts
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls ToDoThoughts
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
NPM scripts are executed in the shell from which NPM was invoked.
NODE_PATH=$NODE_PATH:./app node server will not behave correctly if you're using the command prompt or Powershell on Windows. If you already have Git installed, then you should use Git Bash which should already be available.
Otherwise, you might install the MSYS' or Cygwin's Bash shell.
Node on installation should be installed in your systems environment variables and should be called using node in PowerShell or cmd.
This should mean there's no need to always insert the node path in your environment variables.
Make sure you're running PowerShell or cmd as administrator as well, this ensure system environment variables are being picked up.
Lastly, in your package.json change to:
"scripts": {
"start": "node server.js",
"dev": "start cmd /k \"webpack-dev-server --progress --colors\" & node server.js"
}
then run npm start and your server should be running.
"scripts": {
"start": "node server.js",
"dev": "start cmd /k \"webpack-dev-server --progress --colors\" & node server.js"
}
npm cache clean
Then clear package-lock.json file
Related
Yesterday I noticed something very odd after cloning my work groups repository. After installing dependencies with npm install, I could not start the devserver (or run any npm scripts) inside the project. Strange. So I then tried to create my own fresh new project with #vue/cli and the same thing happened there.
Environment:
Node: v14.15.0
NPM: v6.14.8
Globally installed Vue Cli: v4.5.8
macOS Catalina: v10.15.7
Package.json in project:
"name": "eezer_app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuetify": "^2.2.11",
"vuex": "^3.4.0"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-eslint": "~4.5.0",
"#vue/cli-plugin-router": "~4.5.0",
"#vue/cli-plugin-vuex": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"vue-cli-plugin-vuetify": "~2.0.7",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.3.0"
}
}
Error output:
➜ eezer_app git:(master) ✗ npm run serve
> eezer_app#0.1.0 serve /Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app
> vue-cli-service serve
sh: vue-cli-service: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! eezer_app#0.1.0 serve: `vue-cli-service serve`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the eezer_app#0.1.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/my-real-name/.npm/_logs/2020-11-03T09_50_50_094Z-debug.log
Debug log file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'serve' ]
2 info using npm#6.14.8
3 info using node#v14.15.0
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle eezer_app#0.1.0~preserve: eezer_app#0.1.0
6 info lifecycle eezer_app#0.1.0~serve: eezer_app#0.1.0
7 verbose lifecycle eezer_app#0.1.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle eezer_app#0.1.0~serve: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle eezer_app#0.1.0~serve: CWD: /Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app
10 silly lifecycle eezer_app#0.1.0~serve: Args: [ '-c', 'vue-cli-service serve' ]
11 info lifecycle eezer_app#0.1.0~serve: Failed to exec serve script
12 verbose stack Error: eezer_app#0.1.0 serve: `vue-cli-service serve`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:315:20)
12 verbose stack at maybeClose (internal/child_process.js:1048:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
13 verbose pkgid eezer_app#0.1.0
14 verbose cwd /Users/my-real-name/Documents/frontend-jensen/UX:UI-2/eezer_app
15 verbose Darwin 19.6.0
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
17 verbose node v14.15.0
18 verbose npm v6.14.8
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error eezer_app#0.1.0 serve: `vue-cli-service serve`
23 error spawn ENOENT
24 error Failed at the eezer_app#0.1.0 serve script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
Same error shows up in a freshly made Vue project created with vue create as well.
It seems that npm is trying to look for dependency packages globally instead of locally in node_modules, since I can run serve by manually selecting the script in local node_module .bin like this:
./node_modules/.bin/vue-cli-service serve
Then it starts perfectly without any fault, so there is no issue with installed node_modules etc. I have tried fixing this since yesterday with no results. I found tips to clear npm cache, delete local node_modules & package-lock.json but it does not work at all. I even re-installed CLT on my Mac.
What happened with my npm? Why does it seem to look for dependencies in my global node_module?
Appreciate any kind of tips since I have exhausted most of my options.
I updated Node, NPM, all my global node modules, ran brew update, reinstalled xcode: sudo rm -rf /Library/Developer/CommandLineTools then xcode-select --install and it seems to be working again.
Same error shows up in a freshly made Vue project created with vue create as well.
created a fresh vue project using #vue/cli and I was able to run npm run serve. Hopefully this helps for anyone else facing this issue.
I am trying to run my azure functions locally by doing npm start or even the simple func start.
It was working perfectly until today when the following error started coming:
The func.deps.json file is here: C:\Program Files\Microsoft\Azure Functions Core Tools and it has the dependency below.
I don't even use this and don't know what it is "Error: An assembly specified in the application dependencies manifest (func.deps.json) was not found: package: 'Marklio.Metadata', version: '1.2.20-beta' path: 'lib/netstandard2.0/Marklio.Metadata.dll' npm "
xxx-api#0.0.1 build:docs C:\Code\xxxx-api
> tsc --sourcemap --lib es2017 src/_doc/index.ts --outDir doc && node doc/index.js
Error:
An assembly specified in the application dependencies manifest (func.deps.json) was not found:
package: 'Marklio.Metadata', version: '1.2.20-beta'
path: 'lib/netstandard2.0/Marklio.Metadata.dll'
npm ERR! code ELIFECYCLE
npm ERR! errno 2147516556
npm ERR! xxxx-api#0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix
$npm_package_config_azureFunctions_outDir`
npm ERR! Exit status 2147516556
npm ERR!
npm ERR! Failed at the xxx-api#0.0.1 install:extensions script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-08-13T04_37_33_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2147516556
npm ERR! panthera-api#0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix
$npm_package_config_azureFunctions_outDir`
npm ERR! Exit status 2147516556
npm ERR!
npm ERR! Failed at the xx-api#0.0.1 install:extensions script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xx\AppData\Roaming\npm-cache\_logs\2020-08-13T04_37_33_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2147516556
npm ERR! xx-api#0.0.1 prestart: `npm run install:extensions`
npm ERR! Exit status 2147516556
npm ERR!
npm ERR! Failed at the xxx-api#0.0.1 prestart script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xx\AppData\Roaming\npm-cache\_logs\2020-08-13T04_37_33_241Z-debug.log
My package.json file scripts are as follows:
"scripts": {
"build": "npm run clean && tsc && npm run build:configFiles && npm run build:docs",
"build:production": "npm run prestart && cross-var rimraf $npm_package_config_azureFunctions_outDir/local.*.json && cross-var copyfiles package.json $npm_package_config_azureFunctions_outDir && cd dist && npm install --production",
"build:configFiles": "cross-var copyfiles -u 1 \"$npm_package_config_azureFunctions_rootDir/**/*.json\" $npm_package_config_azureFunctions_outDir",
"build:docs": "tsc --sourcemap --lib es2017 src/_doc/index.ts --outDir doc && node doc/index.js",
"prestart": "npm run install:extensions",
"start": "npm-run-all -p start:host watch watch:config",
"start:doc": "npm run install:extensions && npm run start:host",
"start:host": "cross-var func host start --prefix $npm_package_config_azureFunctions_outDir",
"watch": "tsc --w",
"watch:config": "cross-var onchange \"$npm_package_config_azureFunctions_rootDir/**/*.json\" -- npm run build:configFiles",
"clean": "cross-var rimraf $npm_package_config_azureFunctions_outDir",
"install:extensions": "npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir",
"install:extensions:force": "npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir --force",
"test": "jest",
"precommit-msg": "echo 'Pre-commit checks...' && exit 0",
"fix": "eslint --ext .ts --fix ",
"fix-dry-run": "eslint --ext .ts --fix-dry-run",
"lint": "eslint . --ext .ts"
},
Finally, the contents of the log file mentioned above:
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 'install:extensions'
1 verbose cli ]
2 info using npm#6.14.5
3 info using node#v12.18.1
4 verbose run-script [
4 verbose run-script 'preinstall:extensions',
4 verbose run-script 'install:extensions',
4 verbose run-script 'postinstall:extensions'
4 verbose run-script ]
5 info lifecycle xxx-api#0.0.1~preinstall:extensions: xxx-api#0.0.1
6 info lifecycle xxx-api#0.0.1~install:extensions: xxx-api#0.0.1
7 verbose lifecycle xxx-api#0.0.1~install:extensions: unsafe-perm in lifecycle true
8 verbose lifecycle xxx-api#0.0.1~install:extensions: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Code\xxxAPI\xxx-api\node_modules\.bin;C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Code\xxxAPI\xxx-api\node_modules\.bin;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Roaming\npm;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files\Microsoft MPI\Bin\;C:\ProgramData\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\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\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Seq\;C:\Program Files\Seq\Client\;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Program Files\Microsoft\Azure Functions Core Tools\;C:\Program Files (x86)\GitExtensions\;C:\Program Files (x86)\dotnet\;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Roaming\npm;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Local\Microsoft\WindowsApps;C:\Users\xxx Sharma.STATEMERCANTILE\.dotnet\tools;C:\Users\xxx Sharma.STATEMERCANTILE\AppData\Local\Programs\Microsoft VS Code\bin;
9 verbose lifecycle xxx-api#0.0.1~install:extensions: CWD: C:\Code\xxxAPI\xxx-api
10 silly lifecycle xxx-api#0.0.1~install:extensions: Args: [
10 silly lifecycle '/d /s /c',
10 silly lifecycle 'npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir'
10 silly lifecycle ]
11 silly lifecycle xxx-api#0.0.1~install:extensions: Returned: code: 2147516556 signal: null
12 info lifecycle xxx-api#0.0.1~install:extensions: Failed to exec install:extensions script
13 verbose stack Error: xxx-api#0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir`
13 verbose stack Exit status 2147516556
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:315:20)
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:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid xxx-api#0.0.1
15 verbose cwd C:\Code\xxxAPI\xxx-api
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" "install:extensions"
18 verbose node v12.18.1
19 verbose npm v6.14.5
20 error code ELIFECYCLE
21 error errno 2147516556
22 error xxx-api#0.0.1 install:extensions: `npm run build && cross-var func extensions install --prefix $npm_package_config_azureFunctions_outDir`
22 error Exit status 2147516556
23 error Failed at the xxx-api#0.0.1 install:extensions script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2147516556, true ]
Remove all references of this Marklio dependency from the func.deps.json and run this: npm i -g azure-functions-core-tools#3 --unsafe-perm true
I found that if you go to the path specified after the error message, and delete the Releases folder and run Visual Studio, it will redownload everything you need and it will run fine.
I am trying to setup selenium standalone server with various browsers the script works fine on my local machine but same has issues working on Azure cloud using Azure DevOps tool.
From the logs (Detailed logs at the end) I see the below but not sure how to fix it:
2020-04-17T21:39:25.3581171Z Usage: selenium-standalone action [options]
2020-04-17T21:39:25.3581533Z
2020-04-17T21:39:25.3582171Z npm ERR! Linux 5.0.0-1031-azure
2020-04-17T21:39:25.3582843Z npm ERR! argv "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node" "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm" "run" "e2e-setup"
2020-04-17T21:39:25.3583217Z npm ERR! node v6.17.1
2020-04-17T21:39:25.3583400Z npm ERR! npm v3.10.10
2020-04-17T21:39:25.3583580Z npm ERR! code ELIFECYCLE
2020-04-17T21:39:25.3584038Z npm ERR! temp#1.0.0 e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3584332Z npm ERR! Exit status 255
I have the below package.json:
{
"name": "temp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "nightwatch",
"e2e-setup": "selenium-standalone install"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"#babel/core": "^7.9.0",
"#babel/preset-env": "^7.9.0",
"babel-core": "^6.26.3",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"gulp-babel": "^8.0.0-beta.2",
"selenium-standalone": "^6.17.0"
},
"dependencies": {
"easy-soap-request": "^3.2.2",
"nightwatch": "^1.3.4",
"xmldom": "^0.3.0"
}
}
on VScode when I run
npm install nightwatch
npm install selenium-standalone
and
npm run e2e-setup
I do not have any issues when I try the above on my machine - Selenium server jar and all the browser (chrome, firefox, ie, edge) binaries are getting downloaded)
The above setup is as mentioned in the official seleinum-standalone npm website (https://www.npmjs.com/package/selenium-standalone#install--run)
My Azure CI setup:
But when I try the same on Azure DevOps tool (Running the same on Azure cloud) I am having issues like below:
2020-04-17T21:39:22.1913471Z ##[section]Starting: npm run e2e-setup
2020-04-17T21:39:22.1923363Z ==============================================================================
2020-04-17T21:39:22.1923659Z Task : npm
2020-04-17T21:39:22.1924046Z Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Azure Artifacts.
2020-04-17T21:39:22.1924428Z Version : 1.166.1
2020-04-17T21:39:22.1924652Z Author : Microsoft Corporation
2020-04-17T21:39:22.1924983Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/package/npm
2020-04-17T21:39:22.1925348Z ==============================================================================
2020-04-17T21:39:22.5235427Z SYSTEMVSSCONNECTION exists true
2020-04-17T21:39:22.7105531Z SYSTEMVSSCONNECTION exists true
2020-04-17T21:39:22.7890296Z [command]/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm --version
2020-04-17T21:39:23.0268360Z 3.10.10
2020-04-17T21:39:23.9587311Z [command]/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm config list
2020-04-17T21:39:24.4295571Z ; cli configs
2020-04-17T21:39:24.4297644Z user-agent = "npm/3.10.10 node/v6.17.1 linux x64"
2020-04-17T21:39:24.4298039Z
2020-04-17T21:39:24.4298357Z ; environment configs
2020-04-17T21:39:24.4298785Z userconfig = "/vsts/agent/_work/_temp/npm/830.npmrc"
2020-04-17T21:39:24.4299106Z
2020-04-17T21:39:24.4299481Z ; node bin location = /vsts/agent/_work/_tool/node/6.17.1/x64/bin/node
2020-04-17T21:39:24.4300000Z ; cwd = /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:24.4300385Z ; HOME = /root
2020-04-17T21:39:24.4301230Z ; "npm config ls -l" to show all defaults.
2020-04-17T21:39:24.4301526Z
2020-04-17T21:39:24.4304850Z [command]/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm run e2e-setup
2020-04-17T21:39:25.3579514Z not found: java
2020-04-17T21:39:25.3579860Z
2020-04-17T21:39:25.3581171Z Usage: selenium-standalone action [options]
2020-04-17T21:39:25.3581533Z
2020-04-17T21:39:25.3582171Z npm ERR! Linux 5.0.0-1031-azure
2020-04-17T21:39:25.3582843Z npm ERR! argv "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node" "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm" "run" "e2e-setup"
2020-04-17T21:39:25.3583217Z npm ERR! node v6.17.1
2020-04-17T21:39:25.3583400Z npm ERR! npm v3.10.10
2020-04-17T21:39:25.3583580Z npm ERR! code ELIFECYCLE
2020-04-17T21:39:25.3584038Z npm ERR! temp#1.0.0 e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3584332Z npm ERR! Exit status 255
2020-04-17T21:39:25.3584511Z npm ERR!
2020-04-17T21:39:25.3584965Z npm ERR! Failed at the temp#1.0.0 e2e-setup script 'selenium-standalone install'.
2020-04-17T21:39:25.3585333Z npm ERR! Make sure you have the latest version of node.js and npm installed.
2020-04-17T21:39:25.3585684Z npm ERR! If you do, this is most likely a problem with the temp package,
2020-04-17T21:39:25.3585947Z npm ERR! not with npm itself.
2020-04-17T21:39:25.3586231Z npm ERR! Tell the author that this fails on your system:
2020-04-17T21:39:25.3586678Z npm ERR! selenium-standalone install
2020-04-17T21:39:25.3587020Z npm ERR! You can get information on how to open an issue for this project with:
2020-04-17T21:39:25.3587342Z npm ERR! npm bugs temp
2020-04-17T21:39:25.3587803Z npm ERR! Or if that isn't available, you can get their info via:
2020-04-17T21:39:25.3588109Z npm ERR! npm owner ls temp
2020-04-17T21:39:25.3588351Z npm ERR! There is likely additional logging output above.
2020-04-17T21:39:25.3588530Z
2020-04-17T21:39:25.3588791Z npm ERR! Please include the following file with any support request:
2020-04-17T21:39:25.3589311Z npm ERR! /vsts/agent/_work/r2/a/_QA_IDLookUp/npm-debug.log
2020-04-17T21:39:25.3590596Z > temp#1.0.0 e2e-setup /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:25.3591763Z > selenium-standalone install
2020-04-17T21:39:25.3592087Z
2020-04-17T21:39:25.3734932Z Found npm debug log, make sure the path matches with the one in npm's output: /vsts/agent/_work/r2/a/_QA_IDLookUp/npm-debug.log
2020-04-17T21:39:25.3735698Z 0 info it worked if it ends with ok
2020-04-17T21:39:25.3737184Z 1 verbose cli [ '/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node',
2020-04-17T21:39:25.3738213Z 1 verbose cli '/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm',
2020-04-17T21:39:25.3739010Z 1 verbose cli 'run',
2020-04-17T21:39:25.3739677Z 1 verbose cli 'e2e-setup' ]
2020-04-17T21:39:25.3740072Z 2 info using npm#3.10.10
2020-04-17T21:39:25.3740401Z 3 info using node#v6.17.1
2020-04-17T21:39:25.3741309Z 4 verbose run-script [ 'pree2e-setup', 'e2e-setup', 'poste2e-setup' ]
2020-04-17T21:39:25.3742292Z 5 info lifecycle temp#1.0.0~pree2e-setup: temp#1.0.0
2020-04-17T21:39:25.3743416Z 6 silly lifecycle temp#1.0.0~pree2e-setup: no script for pree2e-setup, continuing
2020-04-17T21:39:25.3744395Z 7 info lifecycle temp#1.0.0~e2e-setup: temp#1.0.0
2020-04-17T21:39:25.3745399Z 8 verbose lifecycle temp#1.0.0~e2e-setup: unsafe-perm in lifecycle true
2020-04-17T21:39:25.3747409Z 9 verbose lifecycle temp#1.0.0~e2e-setup: PATH: /vsts/agent/_work/_tool/node/6.17.1/x64/lib/node_modules/npm/bin/node-gyp-bin:/vsts/agent/_work/r2/a/_QA_IDLookUp/node_modules/.bin:/vsts/agent/_work/_tool/node/6.17.1/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2020-04-17T21:39:25.3749200Z 10 verbose lifecycle temp#1.0.0~e2e-setup: CWD: /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:25.3750457Z 11 silly lifecycle temp#1.0.0~e2e-setup: Args: [ '-c', 'selenium-standalone install' ]
2020-04-17T21:39:25.3751608Z 12 silly lifecycle temp#1.0.0~e2e-setup: Returned: code: 255 signal: null
2020-04-17T21:39:25.3752743Z 13 info lifecycle temp#1.0.0~e2e-setup: Failed to exec e2e-setup script
2020-04-17T21:39:25.3753814Z 14 verbose stack Error: temp#1.0.0 e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3754348Z 14 verbose stack Exit status 255
2020-04-17T21:39:25.3755003Z 14 verbose stack at EventEmitter.<anonymous> (/vsts/agent/_work/_tool/node/6.17.1/x64/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
2020-04-17T21:39:25.3755744Z 14 verbose stack at emitTwo (events.js:106:13)
2020-04-17T21:39:25.3756353Z 14 verbose stack at EventEmitter.emit (events.js:191:7)
2020-04-17T21:39:25.3757140Z 14 verbose stack at ChildProcess.<anonymous> (/vsts/agent/_work/_tool/node/6.17.1/x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
2020-04-17T21:39:25.3757834Z 14 verbose stack at emitTwo (events.js:106:13)
2020-04-17T21:39:25.3758420Z 14 verbose stack at ChildProcess.emit (events.js:191:7)
2020-04-17T21:39:25.3759038Z 14 verbose stack at maybeClose (internal/child_process.js:920:16)
2020-04-17T21:39:25.3759714Z 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
2020-04-17T21:39:25.3760203Z 15 verbose pkgid temp#1.0.0
2020-04-17T21:39:25.3760616Z 16 verbose cwd /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:25.3761457Z 17 error Linux 5.0.0-1031-azure
2020-04-17T21:39:25.3762546Z 18 error argv "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node" "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm" "run" "e2e-setup"
2020-04-17T21:39:25.3763170Z 19 error node v6.17.1
2020-04-17T21:39:25.3763496Z 20 error npm v3.10.10
2020-04-17T21:39:25.3763826Z 21 error code ELIFECYCLE
2020-04-17T21:39:25.3764642Z 22 error temp#1.0.0 e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3765087Z 22 error Exit status 255
2020-04-17T21:39:25.3765921Z 23 error Failed at the temp#1.0.0 e2e-setup script 'selenium-standalone install'.
2020-04-17T21:39:25.3766518Z 23 error Make sure you have the latest version of node.js and npm installed.
2020-04-17T21:39:25.3767106Z 23 error If you do, this is most likely a problem with the temp package,
2020-04-17T21:39:25.3767909Z 23 error not with npm itself.
2020-04-17T21:39:25.3768396Z 23 error Tell the author that this fails on your system:
2020-04-17T21:39:25.3769248Z 23 error selenium-standalone install
2020-04-17T21:39:25.3769864Z 23 error You can get information on how to open an issue for this project with:
2020-04-17T21:39:25.3770358Z 23 error npm bugs temp
2020-04-17T21:39:25.3771224Z 23 error Or if that isn't available, you can get their info via:
2020-04-17T21:39:25.3771966Z 23 error npm owner ls temp
2020-04-17T21:39:25.3772352Z 23 error There is likely additional logging output above.
2020-04-17T21:39:25.3772813Z 24 verbose exit [ 1, true ]
2020-04-17T21:39:25.3773034Z
2020-04-17T21:39:25.3775507Z ##[error]Error: Npm failed with return code: 1
2020-04-17T21:39:25.3816759Z ##[section]Finishing: npm run e2e-setup
The version of node and npm seem to be very old. I have been running nightwatch tests using selenium on travis, azure devops and github actions. My advice is to have the configuration through a yml file which is very simple. You can see mine in the below link and try it.
Reference: https://github.com/spnraju/nightwatchjs-selenium-example/blob/master/azure-pipelines.yml
Out of the blue build script started to fail. No changes in environment or configs at all. Works fine in dev, fails in prod.
Both dev and prod (both Ubuntus):
$ npm -v
5.3.0
$ node -v
v6.11.2
In dev:
oleg#DevVM ~/Code/loaded.bike/assets $ npm run deploy
> # deploy /home/oleg/Code/loaded.bike/assets
> brunch build --production
17:49:59 - info: compiling
17:49:59 - info: compiled 19 files into 2 files, copied 32 in 6.9 sec
In prod:
deploy#loaded-bike-app:~/builds/assets$ npm run deploy
> # deploy /home/deploy/builds/assets
> brunch build --production
00:45:30 - error: Initialization error - Could not load global module 'jquery'. Possible solution: add 'jquery' to package.json and `npm install`. Could not load global module 'jquery'. Possible solution: add 'jquery' to package.json and `npm install`.
Stack trace was suppressed. Run with `LOGGY_STACKS=1` to see the trace.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # deploy: `brunch build --production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/deploy/.npm/_logs/2017-08-12T00_45_30_084Z-debug.log
Full log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'deploy' ]
2 info using npm#5.3.0
3 info using node#v6.11.2
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle #~predeploy: #
6 info lifecycle #~deploy: #
7 verbose lifecycle #~deploy: unsafe-perm in lifecycle true
8 verbose lifecycle #~deploy: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/deploy/builds/assets/node_modules/.bin:/home/deploy/bin:/home/deploy/.local
/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle #~deploy: CWD: /home/deploy/builds/assets
10 silly lifecycle #~deploy: Args: [ '-c', 'brunch build --production' ]
11 silly lifecycle #~deploy: Returned: code: 1 signal: null
12 info lifecycle #~deploy: Failed to exec deploy script
13 verbose stack Error: # deploy: `brunch build --production`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at EventEmitter.emit (events.js:191:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:891:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid #
15 verbose cwd /home/deploy/builds/assets
16 verbose Linux 4.8.0-41-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
18 verbose node v6.11.2
19 verbose npm v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error # deploy: `brunch build --production`
22 error Exit status 1
23 error Failed at the # deploy script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Adding jquery, tether to package.json fixes require error but then it just chokes on sass compile. Is this just JS missfiring async function out of order or what is going here? Once again, it started to fail completely out of the blue. Deployed just fine yesterday and today if fails without me changing anything. Any clue what might be wrong here?
EDIT:
package.json:
{
"repository": {},
"license": "MIT",
"scripts": {
"deploy": "brunch build --production",
"watch": "brunch watch --stdin"
},
"dependencies": {
"bootstrap": "^4.0.0-alpha.6",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html"
},
"devDependencies": {
"babel-brunch": "6.0.6",
"brunch": "2.10.10",
"clean-css-brunch": "2.10.0",
"css-brunch": "2.10.0",
"sass-brunch": "2.10.4",
"uglify-js-brunch": "2.1.1"
}
}
I'm actually seeing this crap on prod (but not on dev)
npm ERR! peer dep missing: jquery#>=3.0.0, required by bootstrap#4.0.0-beta
npm ERR! peer dep missing: popper.js#^1.11.0, required by bootstrap#4.0.0-beta
What is that about? Bootstrap defines those as dependencies (not peerDependency) in its own package.json. npm doesn't pull in dependencies now?
"bootstrap": "^4.0.0-alpha.6"
Needed to lock the version. Bootstrap went from alpha.6 to beta yesterday. Messed everything up. No idea why is started to fail only on one machine (even after npm cache clear). Sass compile fails under beta, so I locked it to alpha.6 for now.
I think I need to start locking dependency versions. This took way too long to figure out.
My environment:
Centos7 via VirtualBox (installed on Windows7)
Node version: 6.10.3
Npm version : 3.10.10
I'm behind a corporate proxy
I initialized a new project "vuetest" with vue-cli, and now I want to run a webpack server.
I use the following command:
npm run dev
This command is equivalent to "webpack-dev-server --open --hot", here is my "package.json" file to check:
{
"name": "vuetest",
"description": "A Vue.js project",
"version": "1.0.0",
"author": "",
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"vue": "^2.3.3"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-preset-env": "^1.5.1",
"cross-env": "^3.2.4",
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"vue-loader": "^12.1.0",
"vue-template-compiler": "^2.3.3",
"webpack": "^2.6.1",
"webpack-dev-server": "^2.4.5"
}
}
But I get the following error:
> vuetest#1.0.0 dev /var/www/html/vuetest
> cross-env NODE_ENV=development webpack-dev-server --open --hot
Project is running at http://localhost:8080/
webpack output is served from /dist/
404s will fallback to /index.html
internal/child_process.js:319
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:1018:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at Object.exports.spawn (child_process.js:378:9)
at module.exports (/var/www/html/vuetest/node_modules/opn/index.js:75:24)
at reportReadiness (/var/www/html/vuetest/node_modules/webpack-dev-server/bin/webpack-dev-server.js:424:3)
at Server.<anonymous> (/var/www/html/vuetest/node_modules/webpack-dev-server/bin/webpack-dev-server.js:404:4)
at Server.g (events.js:292:16)
at emitNone (events.js:86:13)
at Server.emit (events.js:185:7)
at emitListeningNT (net.js:1284:10)
npm ERR! Linux 3.10.0-514.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! vuetest#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vuetest#1.0.0 dev script 'cross-env NODE_ENV=development webpack-dev-server --open --hot'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the vuetest package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development webpack-dev-server --open --hot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs vuetest
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls vuetest
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/vuetest/npm-debug.log
Here's the contents of the "npm-debug.log" file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using npm#3.10.10
3 info using node#v6.10.3
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle vuetest#1.0.0~predev: vuetest#1.0.0
6 silly lifecycle vuetest#1.0.0~predev: no script for predev, continuing
7 info lifecycle vuetest#1.0.0~dev: vuetest#1.0.0
8 verbose lifecycle vuetest#1.0.0~dev: unsafe-perm in lifecycle true
9 verbose lifecycle vuetest#1.0.0~dev: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/var/www/html/vuetest/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/bdupre/.local/bin:/home/bdupre/bin
10 verbose lifecycle vuetest#1.0.0~dev: CWD: /var/www/html/vuetest
11 silly lifecycle vuetest#1.0.0~dev: Args: [ '-c',
11 silly lifecycle 'cross-env NODE_ENV=development webpack-dev-server --open --hot' ]
12 silly lifecycle vuetest#1.0.0~dev: Returned: code: 1 signal: null
13 info lifecycle vuetest#1.0.0~dev: Failed to exec dev script
14 verbose stack Error: vuetest#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid vuetest#1.0.0
16 verbose cwd /var/www/html/vuetest
17 error Linux 3.10.0-514.el7.x86_64
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
19 error node v6.10.3
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error vuetest#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
22 error Exit status 1
23 error Failed at the vuetest#1.0.0 dev script 'cross-env NODE_ENV=development webpack-dev-server --open --hot'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the vuetest package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error cross-env NODE_ENV=development webpack-dev-server --open --hot
23 error You can get information on how to open an issue for this project with:
23 error npm bugs vuetest
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls vuetest
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Does anyone know how to fix it please?
I found the solution.
In the "package.json" file, I replaced:
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot"
By this :
"dev": "cross-env NODE_ENV=development webpack-dev-server --port 8080 --hot --host 0.0.0.0"
And now everything works, my server, starts up normally.
As Emil said, this is a problem with opn module, because xdg-open is not executable.
I have the same problem in a project generated with vue-cli, that uses opn 5.1.0.
Simply doing chmod +x node_modules/opn/xdg-open will solve this. But each time node module is updated this change will be lost.
I ended up commenting the call to opn in build/dev-server.js:
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
//opn(uri)
}
and opening manually my browser on http://localhost:8080
node_modules/opn/xdg-open is not executable, if you're on linux this is what fails at opn/index.js line 75
or add this
console.log(cmd, args, cpOpts);
before line 75 in node_modules/opn/index.js to see exactly which command fails
can you check if the port 8080 for your dev server is already in use? Just hit http://localhost:8080 in your browser or change the port in the webpack.config.js and try again. I had a similar issue, maybe thats it.
Checking at your trace log, this problem occur into module opn, exactly in line 75 of index.js
Error: spawn EACCES
at exports._errnoException (util.js:1018:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at Object.exports.spawn (child_process.js:378:9)
at module.exports (/var/www/html/vuetest/node_modules/opn/index.js:75:24)
looking in that file, we see:
50 } else {
51 if (opts.app) {
52 cmd = opts.app;
53 } else {
54 cmd = path.join(__dirname, 'xdg-open');
55 }
56
57 if (appArgs.length > 0) {
58 args = args.concat(appArgs);
59 }
60
61 if (!opts.wait) {
62 // xdg-open will block the process unless
63 // stdio is ignored even if it's unref'd
64 cpOpts.stdio = 'ignore';
65 }
66 }
67
68 args.push(target);
69
70 if (process.platform === 'darwin' && appArgs.length > 0) {
71 args.push('--args');
72 args = args.concat(appArgs);
73 }
74
75 var cp = childProcess.spawn(cmd, args, cpOpts);
Probably node is trying to run xdg-open which is a bash script so it needs execution permission.
Try :
chmod a+x xdg-open
or, if you are in the root of your project:
chmod a+x node_modules/opn/xdg-open
PS: Usually all these files have correct permissions. In a deseperate situation you always can delete directory node_modules and run npm install again.