Unable to run npm scripts via Azure pipeline says permission denied - npm

I have followed the link to configure cypress test to Azure pipeline.
https://medium.com/#schathurangajayasinghe/ci-with-azure-in-cypress-af2bbb7a46c4
After installation of npm. I am unable to run cypress command defined in package.json.
Adding content from my package.json
"devDependencies": {
"cypress": "^4.6.0",
"cypress-multi-reporters": "^1.2.4",
"mocha-junit-reporter": "^1.23.3"
},
"scripts": {
"scripts": "./node_modules/.bin/cypress run",
"test": "npm run scripts",
"test1": "echo \"Error: no test specified\" && exit 1"
},
This is my cypress.json code:
"reporter": "mocha-junit-reporter",
"reporterOptions": {
"mochaFile": "cypress/reports/junit/test-results.[hash].xml",
"testsuitesTitle": false
}
Adding YML details
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool#0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
- script: |
sudo npm install
displayName: 'npm install'
- task: Npm#1
inputs:
command: 'custom'
customCommand: 'run test'
continueOnError: true
- task: PublishTestResults#2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '*.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/cypress/reports/junit'
mergeTestResults: true
testRunTitle: 'Publish Test Results'
Below is the complete error details from pipeline job run
I am not able to find any solution for error
2020-05-26T04:34:15.9216045Z ##[section]Starting: Npm
2020-05-26T04:34:15.9225064Z ==============================================================================
2020-05-26T04:34:15.9225380Z Task : npm
2020-05-26T04:34:15.9225735Z Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Azure Artifacts.
2020-05-26T04:34:15.9226103Z Version : 1.169.1
2020-05-26T04:34:15.9226316Z Author : Microsoft Corporation
2020-05-26T04:34:15.9226618Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/package/npm
2020-05-26T04:34:15.9226975Z ==============================================================================
2020-05-26T04:34:16.2629701Z SYSTEMVSSCONNECTION exists true
2020-05-26T04:34:16.9531740Z SYSTEMVSSCONNECTION exists true
2020-05-26T04:34:16.9545193Z [command]/opt/hostedtoolcache/node/12.16.3/x64/bin/npm --version
2020-05-26T04:34:17.2314792Z 6.14.4
2020-05-26T04:34:17.6413569Z [command]/opt/hostedtoolcache/node/12.16.3/x64/bin/npm config list
2020-05-26T04:34:17.8370814Z ; cli configs
2020-05-26T04:34:17.8371879Z metrics-registry = `enter code here`"https://registry.npmjs.org/"
2020-05-26T04:34:17.8372133Z scope = ""
2020-05-26T04:34:17.8372525Z user-agent = "npm/6.14.4 node/v12.16.3 linux x64"
2020-05-26T04:34:17.8372690Z
2020-05-26T04:34:17.8372821Z ; environment configs
2020-05-26T04:34:17.8373011Z userconfig = "/home/vsts/work/1/npm/41.npmrc"
2020-05-26T04:34:17.8373157Z
2020-05-26T04:34:17.8373370Z ; node bin location = /opt/hostedtoolcache/node/12.16.3/x64/bin/node
2020-05-26T04:34:17.8373651Z ; cwd = /home/vsts/work/1/s
2020-05-26T04:34:17.8373816Z ; HOME = /home/vsts
2020-05-26T04:34:17.8374186Z ; "npm config ls -l" to show all defaults.
2020-05-26T04:34:17.8374338Z
2020-05-26T04:34:17.8385945Z [command]/opt/hostedtoolcache/node/12.16.3/x64/bin/npm run test
2020-05-26T04:34:18.3150165Z
2020-05-26T04:34:18.3150845Z > cypresspipe#1.0.0 test /home/vsts/work/1/s
2020-05-26T04:34:18.3151403Z > npm run scripts
2020-05-26T04:34:18.3151620Z
2020-05-26T04:34:18.3151833Z
2020-05-26T04:34:18.3152121Z > cypresspipe#1.0.0 scripts /home/vsts/work/1/s
**2020-05-26T04:34:18.3152416Z > cypress run** this command is coming from package.json
2020-05-26T04:34:18.3152610Z
**2020-05-26T04:34:18.3204244Z sh: 1: cypress: Permission denied**
2020-05-26T04:34:18.3811970Z npm ERR! code ELIFECYCLE
2020-05-26T04:34:18.3812168Z npm ERR! errno 126
2020-05-26T04:34:18.3812371Z npm ERR! cypresspipe#1.0.0 scripts: `cypress run`
2020-05-26T04:34:18.3812992Z npm ERR! Exit status 126
2020-05-26T04:34:18.3813124Z npm ERR!
2020-05-26T04:34:18.3813477Z npm ERR! Failed at the cypresspipe#1.0.0 scripts script.
2020-05-26T04:34:18.3813789Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-05-26T04:34:18.3814045Z
2020-05-26T04:34:18.3814228Z npm ERR! A complete log of this run can be found in:
2020-05-26T04:34:18.3814731Z npm ERR! /home/vsts/.npm/_logs/2020-05-26T04_34_18_291Z-debug.log
2020-05-26T04:34:18.3814975Z npm ERR! code ELIFECYCLE
2020-05-26T04:34:18.3815122Z npm ERR! errno 126
2020-05-26T04:34:18.3815542Z npm ERR! cypresspipe#1.0.0 test: `npm run scripts`
2020-05-26T04:34:18.3816150Z npm ERR! Exit status 126
2020-05-26T04:34:18.3816287Z npm ERR!
2020-05-26T04:34:18.3816460Z npm ERR! Failed at the cypresspipe#1.0.0 test script.
2020-05-26T04:34:18.3816746Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-05-26T04:34:18.3816968Z
2020-05-26T04:34:18.3817147Z npm ERR! A complete log of this run can be found in:
2020-05-26T04:34:18.3817633Z npm ERR! /home/vsts/.npm/_logs/2020-05-26T04_34_18_306Z-debug.log
2020-05-26T04:34:18.3820304Z Found npm debug log, make sure the path matches with the one in npm's output: /home/vsts/.npm/_logs/2020-05-26T04_34_18_306Z-debug.log
2020-05-26T04:34:18.3820654Z 0 info it worked if it ends with ok
2020-05-26T04:34:18.3820827Z 1 verbose cli [
2020-05-26T04:34:18.3821175Z 1 verbose cli '/opt/hostedtoolcache/node/12.16.3/x64/bin/node',
2020-05-26T04:34:18.3821583Z 1 verbose cli '/opt/hostedtoolcache/node/12.16.3/x64/bin/npm',
2020-05-26T04:34:18.3822132Z 1 verbose cli 'run',
2020-05-26T04:34:18.3822409Z 1 verbose cli 'test'
2020-05-26T04:34:18.3822552Z 1 verbose cli ]
2020-05-26T04:34:18.3822689Z 2 info using npm#6.14.4
2020-05-26T04:34:18.3822857Z 3 info using node#v12.16.3
2020-05-26T04:34:18.3823190Z 4 verbose run-script [ 'pretest', 'test', 'posttest' ]
2020-05-26T04:34:18.3823447Z 5 info lifecycle cypresspipe#1.0.0~pretest: cypresspipe#1.0.0
2020-05-26T04:34:18.3823738Z 6 info lifecycle cypresspipe#1.0.0~test: cypresspipe#1.0.0
2020-05-26T04:34:18.3824434Z 7 verbose lifecycle cypresspipe#1.0.0~test: unsafe-perm in lifecycle true
2020-05-26T04:34:18.3826130Z 8 verbose lifecycle cypresspipe#1.0.0~test: PATH: /opt/hostedtoolcache/node/12.16.3/x64/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/vsts/work/1/s/node_modules/.bin:/opt/hostedtoolcache/node/12.16.3/x64/bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin
2020-05-26T04:34:18.3827060Z 9 verbose lifecycle cypresspipe#1.0.0~test: CWD: /home/vsts/work/1/s
2020-05-26T04:34:18.3827551Z 10 silly lifecycle cypresspipe#1.0.0~test: Args: [ '-c', 'npm run scripts' ]
2020-05-26T04:34:18.3827919Z 11 silly lifecycle cypresspipe#1.0.0~test: Returned: code: 126 signal: null
2020-05-26T04:34:18.3828247Z 12 info lifecycle cypresspipe#1.0.0~test: Failed to exec test script
2020-05-26T04:34:18.3828552Z 13 verbose stack Error: cypresspipe#1.0.0 test: `npm run scripts`
2020-05-26T04:34:18.3828807Z 13 verbose stack Exit status 126
2020-05-26T04:34:18.3829373Z 13 verbose stack at EventEmitter.<anonymous> (/opt/hostedtoolcache/node/12.16.3/x64/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
2020-05-26T04:34:18.3829960Z 13 verbose stack at EventEmitter.emit (events.js:310:20)
2020-05-26T04:34:18.3830814Z 13 verbose stack at ChildProcess.<anonymous> (/opt/hostedtoolcache/node/12.16.3/x64/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
2020-05-26T04:34:18.3831256Z 13 verbose stack at ChildProcess.emit (events.js:310:20)
2020-05-26T04:34:18.3831746Z 13 verbose stack at maybeClose (internal/child_process.js:1021:16)
2020-05-26T04:34:18.3832122Z 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
2020-05-26T04:34:18.3832414Z 14 verbose pkgid cypresspipe#1.0.0
2020-05-26T04:34:18.3832613Z 15 verbose cwd /home/vsts/work/1/s
2020-05-26T04:34:18.3833308Z 16 verbose Linux 5.3.0-1020-azure
2020-05-26T04:34:18.3833804Z 17 verbose argv "/opt/hostedtoolcache/node/12.16.3/x64/bin/node" "/opt/hostedtoolcache/node/12.16.3/x64/bin/npm" "run" "test"
2020-05-26T04:34:18.3834301Z 18 verbose node v12.16.3
2020-05-26T04:34:18.3834673Z 19 verbose npm v6.14.4
2020-05-26T04:34:18.3835103Z 20 error code ELIFECYCLE
2020-05-26T04:34:18.3835252Z 21 error errno 126
2020-05-26T04:34:18.3835458Z 22 error cypresspipe#1.0.0 test: `npm run scripts`
2020-05-26T04:34:18.3835783Z 22 error Exit status 126
2020-05-26T04:34:18.3835980Z 23 error Failed at the cypresspipe#1.0.0 test script.
2020-05-26T04:34:18.3836277Z 23 error This is probably not a problem with npm. There is likely additional logging output above.
2020-05-26T04:34:18.3836562Z 24 verbose exit [ 126, true ]
2020-05-26T04:34:18.3836682Z
2020-05-26T04:34:18.3870900Z ##[error]Error: Npm failed with return code: 126
2020-05-26T04:34:18.3885472Z ##[section]Finishing: Npm

Related

How can I fix these errors with npm run build on the Next.js default project?

I'm a graphic student trying to learn something further than classic HTML/CSS.
I want to build the default Next.js app, which you can get by npm create-next-app filename.
It certainly works when npm run dev. I can see the index page on localhost:3000.
But npm run build gets:
% npm run build
> test#0.1.0 build /Users/minori/Documents/portfolio/test
> next build
info - Checking validity of types
Failed to compile.
./pages/index.js
8:7 Error: Missing "key" prop for element in array react/jsx-key
/*almost same messages repeated for every line*/
63:13 Error: Missing "key" prop for element in array react/jsx-key
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test#0.1.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test#0.1.0 build 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/minori/.npm/_logs/2022-02-25T17_53_21_317Z-debug.log
And here is the debug log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm#6.14.15
3 info using node#v14.17.6
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle test#0.1.0~prebuild: test#0.1.0
6 info lifecycle test#0.1.0~build: test#0.1.0
7 verbose lifecycle test#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle test#0.1.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/minori/Documents/portfolio/test/node_modules/.bin:/Users/minori/.npm-global/lib/node_modules/n/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/minori/bin:/opt/osxws/bin:/opt/osxws/sbin
9 verbose lifecycle test#0.1.0~build: CWD: /Users/minori/Documents/portfolio/test
10 silly lifecycle test#0.1.0~build: Args: [ '-c', 'next build' ]
11 silly lifecycle test#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle test#0.1.0~build: Failed to exec build script
13 verbose stack Error: test#0.1.0 build: `next build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid test#0.1.0
15 verbose cwd /Users/minori/Documents/portfolio/test
16 verbose Darwin 20.3.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v14.17.6
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error test#0.1.0 build: `next build`
22 error Exit status 1
23 error Failed at the test#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I already tried npm install -g npm-rm -rf node_modules-npm install, re-installing node.js, npm cache clear --force and rm package-lock.json.
Does anyone know what the problem is?
What else can I try now?
It's not you, there is an issue logged with eslint-plugin-react that create-next-app uses, if they haven't already done so (try npm create-next-app again) you can find eslint-plugin-react in your package.json to version 7.29.1
You can see the Vercel team noting the change and the eslint-plugin-react author's responding
https://github.com/yannickcr/eslint-plugin-react/issues/3215#issuecomment-1051115159

Webpack error compiling theme in Prestashop

Trying to compile theme (named foo) in Prestashop:
cd themes/foo/_dev
npm run build
Get the following error.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! prestashop-classic-dev-tools#1.0.0 build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the prestashop-classic-dev-tools#1.0.0 build 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! /root/.npm/_logs/2021-07-02T05_58_35_445Z-debug.log
Here is the log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm#6.14.13
3 info using node#v14.17.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle prestashop-classic-dev-tools#1.0.0~prebuild: prestashop-classic-dev-tools#1.0.0
6 info lifecycle prestashop-classic-dev-tools#1.0.0~build: prestashop-classic-dev-tools#1.0.0
7 verbose lifecycle prestashop-classic-dev-tools#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle prestashop-classic-dev-tools#1.0.0~build: PATH: /usr/lib/node_modules/npm/node_mod$
9 verbose lifecycle prestashop-classic-dev-tools#1.0.0~build: CWD: /var/www/html/themes/foo$
10 silly lifecycle prestashop-classic-dev-tools#1.0.0~build: Args: [ '-c', 'webpack' ]
11 silly lifecycle prestashop-classic-dev-tools#1.0.0~build: Returned: code: 2 signal: null
12 info lifecycle prestashop-classic-dev-tools#1.0.0~build: Failed to exec build script
13 verbose stack Error: prestashop-classic-dev-tools#1.0.0 build: `webpack`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle$
13 verbose stack at EventEmitter.emit (events.js:376:20)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle$
13 verbose stack at ChildProcess.emit (events.js:376:20)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid prestashop-classic-dev-tools#1.0.0
15 verbose cwd /var/www/html/themes/foo/_dev
16 verbose Linux 5.8.0-59-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v14.17.0
19 verbose npm v6.14.13
20 error code ELIFECYCLE
21 error errno 2
22 error prestashop-classic-dev-tools#1.0.0 build: `webpack`
22 error Exit status 2
23 error Failed at the prestashop-classic-dev-tools#1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
npm version is:
> npm -v
6.14.13
What could be the cause?
Cause of the issue not found. Resolved with the following commands:
Clean npm cache
> npm cache clean --force
Remove node modules
> rm -rf node_modules package-lock.json
Install npm
> npm install
Run build
> npm run build

IBM blockchain platform Visual Studio Code : Error while Packaging Smart Contract

I'm having trouble figuring out the issue while packaging Smart Contract on the IBM Blockchain Platform on Visual Studio Code. I installed the following:
Node.js v14.16.0
npm 6.14.11
Docker version 19.03.13, build cd8016b6bc
docker-compose version 1.25.5, build unknown
I successfully create a new smart contract project. When I ram command - package open project in Command Pallete.
I received this error message:
> Executing task in folder demoContract: npm run build <
> demoContract#0.0.1 build /home/shubham14/Desktop/Major project - blockchain/demoContract
> tsc
sh: 1: tsc: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! demoContract#0.0.1 build: `tsc`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the demoContract#0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/shubham14/.npm/_logs/2021-03-03T11_38_29_505Z-debug.log
The terminal process "/bin/bash '-c', 'npm run build'" terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
**Debug-log :**
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm#6.14.11
3 info using node#v14.16.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle demoContract#0.0.1~prebuild: demoContract#0.0.1
6 info lifecycle demoContract#0.0.1~build: demoContract#0.0.1
7 verbose lifecycle demoContract#0.0.1~build: unsafe-perm in lifecycle true
8 verbose lifecycle demoContract#0.0.1~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/shubham14/Desktop/Major project - blockchain/demoContract/node_modules/.bin:/home/shubham14/Desktop/jdk-14/bin:/home/shubham14/anaconda3/lib/graphviz:/home/apache-maven-3.6.3/bin:/home/shubham14/anaconda3/bin:/home/shubham14/anaconda3/condabin:/home/shubham14/jdk-14_linux-x64_bin/jdk-14/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle demoContract#0.0.1~build: CWD: /home/shubham14/Desktop/Major project - blockchain/demoContract
10 silly lifecycle demoContract#0.0.1~build: Args: [ '-c', 'tsc' ]
11 info lifecycle demoContract#0.0.1~build: Failed to exec build script
12 verbose stack Error: demoContract#0.0.1 build: `tsc`
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 demoContract#0.0.1
14 verbose cwd /home/shubham14/Desktop/Major project - blockchain/demoContract
15 verbose Linux 5.4.0-42-generic
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
17 verbose node v14.16.0
18 verbose npm v6.14.11
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error demoContract#0.0.1 build: `tsc`
23 error spawn ENOENT
24 error Failed at the demoContract#0.0.1 build script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
Try running npm install first (and maybe even reloading VS Code afterwards).

"vue-cli-service test:unit " runs succesfully; but npm exits err code 1 ELIFECYCLE

I'm trying to run npm run test:unit and the true error seems to be test:unit: Failed to exec test:unit script from the npm debug.log. Yet the script DOES run and execute without issue.
I'm a little new to NPM + Node so I'm struggling with this behavior. When I run npm run test:unit ( "test:unit": "vue-cli-service test:unit" in Package.json) I get this output:
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 1 file obsolete, 0 total
Time: 1.208s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cheatsheet#0.1.0 test:unit: `vue-cli-service test:unit`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cheatsheet#0.1.0 test:unit 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/max/.npm/_logs/2020-03-26T18_16_36_155Z-debug.log
Expected Result
The tests should just pass, I shouldn't see NPM/Node crash.
Running ./node_modules/.bin/vue-cli-service test:unit I get just the test and Jest output. Everything works as expected. So what is going wrong with my setup?
Attempted Resolution
reinstalled node_modules
updated npm
updated to node:stable
reinstall nvm (node version manager) and updated
attempted to add extra debug flags to vue-cli-service
npm_debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/max/.nvm/versions/node/v13.11.0/bin/node',
1 verbose cli '/home/max/.nvm/versions/node/v13.11.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'test:unit'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v13.11.0
4 verbose run-script [ 'pretest:unit', 'test:unit', 'posttest:unit' ]
5 info lifecycle cheatsheet#0.1.0~pretest:unit: cheatsheet#0.1.0
6 info lifecycle cheatsheet#0.1.0~test:unit: cheatsheet#0.1.0
7 verbose lifecycle cheatsheet#0.1.0~test:unit: unsafe-perm in lifecycle true
8 verbose lifecycle cheatsheet#0.1.0~test:unit: PATH: /home/max/.nvm/versions/node/v13.11.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/max/cheatsheet_project/cheatsheet/node_modules/.bin:/home/max/.pyenv/plugins/pyenv-virtualenv/shims:/home/max/.pyenv/shims:~/.pyenv/bin:/home/max/Maven/apache-maven-3.5.2/bin:/home/max/.nvm/versions/node/v13.11.0/bin:/home/max/.rbenv/shims:/home/max/.rbenv/bin:/home/max/workspace/go/bin:/home/max/.cargo/bin:/home/max/.cargo/bin:/home/max/bin:/home/max/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-9-oracle/bin:/usr/lib/jvm/java-9-oracle/db/bin:/usr/lib/jvm/java-9-oracle/bin:/usr/lib/jvm/java-9-oracle/db/bin:/usr/local/go/bin
9 verbose lifecycle cheatsheet#0.1.0~test:unit: CWD: /home/max/cheatsheet_project/cheatsheet
10 silly lifecycle cheatsheet#0.1.0~test:unit: Args: [ '-c', 'vue-cli-service test:unit' ]
11 silly lifecycle cheatsheet#0.1.0~test:unit: Returned: code: 1 signal: null
12 info lifecycle cheatsheet#0.1.0~test:unit: Failed to exec test:unit script
13 verbose stack Error: cheatsheet#0.1.0 test:unit: `vue-cli-service test:unit`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/home/max/.nvm/versions/node/v13.11.0/lib/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> (/home/max/.nvm/versions/node/v13.11.0/lib/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:1026:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid cheatsheet#0.1.0
15 verbose cwd /home/max/cheatsheet_project/cheatsheet
16 verbose Linux 4.15.0-91-generic
17 verbose argv "/home/max/.nvm/versions/node/v13.11.0/bin/node" "/home/max/.nvm/versions/node/v13.11.0/bin/npm" "run" "test:unit"
18 verbose node v13.11.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error cheatsheet#0.1.0 test:unit: `vue-cli-service test:unit`
22 error Exit status 1
23 error Failed at the cheatsheet#0.1.0 test:unit script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
./node_modules/.bin/vue-cli-service test:unit -u fixed this. This is the shorthand command for jest --updatesnapshot.
Since we just updated our component to point to a different address, it's reasonable to expect changes in the snapshot for this component. Our snapshot test case is failing because the snapshot for our updated component no longer matches the snapshot artifact for this test case.
To resolve this, we will need to update our snapshot artifacts. You can run Jest with a flag that will tell it to re-generate snapshots...
- From Snapshot Testing.
Observed the error about snapshots:
Snapshots: 1 file obsolete, 0 total
Unsure why this caused the NPM error but -u cleared it and I haven't seen it again.

How to fix build command issue?

I want to try Tailwind CSS but I meet an issue when I launch "npm run build".
The console returns : tailwind command not found. However I successfully installed it.
I upgrade Node and npm.
this error message :
OnePage#1.0.0 build /Users/ted/Documents/Dweb/HTML : CSS/Projets/OnePage
tailwind build src/css/tailwind.css -o dist/css/tailwind.css
sh: tailwind: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! OnePage#1.0.0 build: `tailwind build src/css/tailwind.css -o dist/css/tailwind.css`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the OnePage#1.0.0 build 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/ted/.npm/_logs/2019-06-15T18_11_03_382Z-debug.log
iMac-de-Ted:OnePage ted$ sudo npm run start
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ted/.npm/_logs/2019-06-15T18_13_18_897Z-debug.log
------------------------------------------------------------------
this is my bug log :
info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run',
'build' ] info using npm#6.9.0
3 info using node#v12.4.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle OnePage#1.0.0~prebuild: OnePage#1.0.0
6 info lifecycle OnePage#1.0.0~build: OnePage#1.0.0
7 verbose lifecycle OnePage#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle OnePage#1.0.0~build: PATH:
/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/ted/Documents/Dweb/HTML
:
CSS/Projets/OnePage/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle OnePage#1.0.0~build: CWD:
/Users/ted/Documents/Dweb/HTML : CSS/Projets/OnePage
10 silly lifecycle OnePage#1.0.0~build: Args: [ 10 silly lifecycle
'-c',
10 silly lifecycle 'tailwind build src/css/tailwind.css -o
dist/css/tailwind.css' 10 silly lifecycle ]
11 info lifecycle OnePage#1.0.0~build: Failed to exec build script 12
verbose stack Error: OnePage#1.0.0 build: tailwind build
src/css/tailwind.css -o dist/css/tailwind.css
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.
(/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:200:13)
12 verbose stack at maybeClose (internal/child_process.js:1021:16)
12 verbose stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:283:5)
13 verbose pkgid OnePage#1.0.0
14 verbose cwd /Users/ted/Documents/Dweb/HTML : CSS/Projets/OnePage
15 verbose Darwin 18.6.0
16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run"
"build"
17 verbose node v12.4.0
18 verbose npm v6.9.0
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error OnePage#1.0.0 build: tailwind build src/css/tailwind.css -o
dist/css/tailwind.css
23 error spawn ENOENT
24 error Failed at the OnePage#1.0.0 build script.
24 error This is probably not a problem with npm. There is likely
additional logging output above. 25 verbose exit [ 1, true ]