I download a demo "react-redux-demo",and when I use the commond "npm install webpack --save-dev" to install webpack, the error shows.
This is the log
8351 verbose unlock done using C:\Users\user\AppData\Roaming\npm-cache\_locks\staging-51622fc2de18aa59.lock for D:\work\test\react-redux-demo\node_modules\.staging
8352 warn The package history is included as both a dev and production dependency.
8353 warn The package react is included as both a dev and production dependency.
8354 warn The package react-router-config is included as both a dev and production dependency.
8355 warn The package react-router-native is included as both a dev and production dependency.
8356 verbose stack Error: ENOENT: no such file or directory, rename 'D:\work\test\react-redux-demo\node_modules\.staging\loader-utils-21a7d1c0\node_modules\big.js'
-> 'D:\work\test\react-redux-demo\node_modules\.staging\big.js-134af3f2'
8357 verbose cwd D:\work\test\react-redux-demo
8358 verbose Windows_NT
10.0.14393
8359 verbose argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "webpack" "--save-dev"
8360 verbose node v8.4.0
8361 verbose npm v5.3.0
8362 error path D:\work\test\react-redux-demo\node_modules\.staging\loader-utils-21a7d1c0\node_modules\big.js
8363 error code ENOENT
8364 error errno -4058
8365 error syscall rename
8366 error enoent ENOENT: no such file or directory, rename 'D:\work\test\react-redux-demo\node_modules\.staging\loader-utils-21a7d1c0\node_modules\big.js'
-> 'D:\work\test\react-redux-demo\node_modules\.staging\big.js-134af3f2'
8367 error enoent This is related to npm not being able to find a file.
8368 verbose exit [ -4058, true ]
Related
I install node 14(LTS) on my window10, and npm is auto install, but npm init isn't work.
I check version of them is work
C:\Users\RURU\Documents\practice\css> node -v
// 14.4
C:\Users\RURU\Documents\practice\css> npm -v
// 6
but, npm init does't work, when I want to init a package.json.
C:\Users\RURU\Documents\practice\css> npm init # neither npm init -y
Error :
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\RURU\Documents\practice\css\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\RURU\Documents\practice\css\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\RURU\AppData\Local\npm-cache\_logs\2021-07-04T14_37_28_289Z-debug.log
Error log:
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 'init'
1 verbose cli ]
2 info using npm#6.14.13
3 info using node#v14.17.2
4 silly package data {
4 silly package data name: 'c',
4 silly package data version: '1.0.0',
4 silly package data description: '',
4 silly package data main: 'index.js',
4 silly package data scripts: { test: 'echo "Error: no test specified" && exit 1' },
4 silly package data author: 'ru',
4 silly package data license: 'ISC'
4 silly package data }
5 info init written successfully
6 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\RURU\Documents\practice\css\package.json'
7 verbose cwd C:\Users\RURU\Documents\practice\css
8 verbose Windows_NT 10.0.19042
9 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "init"
10 verbose node v14.17.2
11 verbose npm v6.14.13
12 error code ENOENT
13 error syscall open
14 error path C:\Users\RURU\Documents\practice\css\package.json
15 error errno -4058
16 error enoent ENOENT: no such file or directory, open 'C:\Users\RURU\Documents\practice\css\package.json'
17 error enoent This is related to npm not being able to find a file.
18 verbose exit [ -4058, true ]
I dont't know how to fix it, can anyone help, please ...
my path
C:\Program Files\nodejs\;C:\Users\RURU\AppData\Roaming\npm
You can use 2 things to solve the problem :
Start the cmd in administrator mode and try again.
Run the command using --unsafe-perms i.e. npm init --unsafe-perms
I don't think 2 step will be required in most of the cases.
I'm trying to build a new NS8 project. I have another NS6.5 project on my computer, but it's in a different folder. When running npm install -g nativescript in a different folder, I get the following error
2323 verbose argv "/Users/.../.nvm/versions/node/v16.4.0/bin/node" "/Users/.../.nvm/versions/node/v16.4.0/bin/npm" "install" "-g" "nativescript"
2324 verbose node v16.4.0
2325 verbose npm v7.18.1
2326 error code ENOENT
2327 error syscall lstat
2328 error path /Users/.../.npm/_cacache/content-v2/sha1/07/e1/3c3118154c53893d3be7a7e08d990e86d859
2329 error errno -2
2330 error enoent ENOENT: no such file or directory, lstat '/Users/.../.npm/_cacache/content-v2/sha1/07/e1/3c3118154c53893d3be7a7e08d990e86d859'
2331 error enoent This is related to npm not being able to find a file.
2332 verbose exit -2
I'm not sure why this is erroring out. Any help would be appreciated. Thanks
I solved this by installing node version 14.17.1 (v6.14.13)
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
I already installed node.js, npm and gulp on my computer (windows 7), but when I'm trying to install gulp on my project's folder with the "npm update --save-dev" commande line, I got an error and I don't know how to fix this. But when I do all these steps on my portable (windows 10) it works perfectly...
Here's the log of the error :
11930 warn test#1.0.0 No repository field.
11931 verbose stack Error: ENOENT: no such file or directory, rename
'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules\source-map' -> 'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules.source-map.DELETE'
11932 verbose cwd G:\Desktop\TFA
11933 verbose Windows_NT 6.1.7601
11934 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "update" "--save-dev"
11935 verbose node v9.9.0
11936 verbose npm v5.6.0
11937 error path G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules\source-map
11938 error code ENOENT
11939 error errno -4058
11940 error syscall rename
11941 error enoent ENOENT: no such file or directory, rename 'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules\source-map' -> 'G:\Desktop\TFA\node_modules\#gulp-sourcemaps\identity-map\node_modules.source-map.DELETE'
11942 error enoent This is related to npm not being able to find a file.
11943 verbose exit [ -4058, true ]
I want to create npm package that can be installed globally. I can publish the package, publish new version, but when I want to install it globally, it is not working.
yarn global add <package> outputs:
success Installed "pentest-tool-lite#0.0.3" with binaries:
- pentest-tool-lite
npm install -g <package> outputs:
npm ERR! path /nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! _logs/2017-12-03T16_00_34_926Z-debug.log
debug log:
7877 info linkStuff pentest-tool-lite#0.0.3
7878 silly linkStuff pentest-tool-lite#0.0.3 has /Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules as its parent node_modules
7879 silly linkStuff pentest-tool-lite#0.0.3 is part of a global install
7880 silly linkStuff pentest-tool-lite#0.0.3 is installed into a global node_modules
7881 silly linkStuff pentest-tool-lite#0.0.3 is installed into the top-level global node_modules
7882 verbose linkBins pentest-tool-lite#0.0.3
7883 verbose linkBins [ { 'pentest-tool-lite': './lib/index' },
7883 verbose linkBins '/Users/juffalow/.nvm/versions/node/v8.7.0/bin',
7883 verbose linkBins true ]
7884 verbose linkMans pentest-tool-lite#0.0.3
7885 verbose unlock done using /Users/juffalow/.npm/_locks/staging-fa43d53d0ab27b11.lock for /Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/.staging
7886 verbose stack Error: ENOENT: no such file or directory, chmod '/Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index'
7887 verbose cwd /Users/juffalow/NetBeansProjects/pentest-tool-lite
7888 verbose Darwin 16.0.0
7889 verbose argv "/Users/juffalow/.nvm/versions/node/v8.7.0/bin/node" "/Users/juffalow/.nvm/versions/node/v8.7.0/bin/npm" "install" "-g" "pentest-tool-lite"
7890 verbose node v8.7.0
7891 verbose npm v5.4.2
7892 error path /Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index
7893 error code ENOENT
7894 error errno -2
7895 error syscall chmod
7896 error enoent ENOENT: no such file or directory, chmod '/Users/juffalow/.nvm/versions/node/v8.7.0/lib/node_modules/pentest-tool-lite/lib/index'
7897 error enoent This is related to npm not being able to find a file.
7898 verbose exit [ -2, true ]
Yarn seems to install it successfully, but not. NPM shows error but I really don't know why? Do you have any experience with module?
Ok, I found the problem. When you want to publish global module to npm, you have to publish build version ( e.g. bin or lib folder ). I had this version but ignored in .gitignore because it need not to be in repo. And when you don't have .npmignore npm uses .gitignore file, so the module was published without build version, therefore without executable files.
Solution: add .npmignore file to the root of the project with:
node_modules/
coverage/