npm install not running package "install" script - node.js

when I run npm install <package>, it seems the "install" script is not run after package install, such as puppeteer, #sentry/cli
npm i puppeteer
added 58 packages in 7s
normally, it should download a chromium binary after the package install, but nothing happened.
I don't think I set some special config in .npmrc
npm config list
; "global" config from /Users/lixiaokai/.nvm/versions/node/v12.22.1/etc/npmrc
ignore-scripts = false
; "user" config from /Users/lixiaokai/.npmrc
//registry.npmjs.org/:_authToken = (protected)
canvas_binary_host_mirror = "https://npm.taobao.org/mirrors/node-canvas-prebuilt/"
chromedriver_cdnurl = "https://npm.taobao.org/mirrors/chromedriver"
electron_mirror = "https://cdn.npm.taobao.org/dist/electron/"
fse_binary_host_mirror = "https://npm.taobao.org/mirrors/fsevents/"
phantomjs_cdnurl = "https://npm.taobao.org/mirrors/phantomjs"
puppeteer_download_host = "https://npm.taobao.org/mirrors"
registry = "https://registry.npm.taobao.org/"
sass_binary_site = "http://npm.taobao.org/mirrors/node-sass"
sharp_libvips_binary_host = "https://npm.taobao.org/mirrors/sharp-libvips"
; node bin location = /Users/lixiaokai/.nvm/versions/node/v12.22.1/bin/node
; cwd = /Users/lixiaokai/code/test
; HOME = /Users/lixiaokai
; Run `npm config ls -l` to show all defaults.
npm versoin 7.16.0
node version 12.22.1
nvm version 0.38.0
the reason why I updated my npm version is when I try to stop npm start script, it throw an error
-debug.log:
10 silly lifecycle mobile-tiku#0.0.1~start: Args: [ '-c', 'umi dev' ]
11 silly lifecycle mobile-tiku#0.0.1~start: Returned: code: 1 signal: null
12 info lifecycle mobile-tiku#0.0.1~start: Failed to exec start script
13 verbose stack Error: mobile-tiku#0.0.1 start: `umi dev`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/Users/lixiaokai/.nvm/versions/node/v12.22.1/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:314:20)
13 verbose stack at ChildProcess.<anonymous> (/Users/lixiaokai/.nvm/versions/node/v12.22.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:314:20)
13 verbose stack at maybeClose (internal/child_process.js:1022:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

Related

How to generate Typescript-Client with openapi-typescript-codegen?

When i install openapi-typescript-codegen
as described in the readme with $ npm install openapi-typescript-codegen --save-dev
it generates a package-lock.json but no package.json and no tsconfig.json. Even if i maually create the package.json and run npm run generate-client it does not work. And throws this log at me:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'generate-client' ]
2 info using npm#6.14.4
3 info using node#v10.19.0
4 verbose run-script [ 'pregenerate-client',
4 verbose run-script 'generate-client',
4 verbose run-script 'postgenerate-client' ]
5 info lifecycle frontend-api-client#1.0.0~pregenerate-client: frontend-api-client#1.0.0
6 info lifecycle frontend-api-client#1.0.0~generate-client: frontend-api-client#1.0.0
7 verbose lifecycle frontend-api-client#1.0.0~generate-client: unsafe-perm in lifecycle true
8 verbose lifecycle frontend-api-client#1.0.0~generate-client: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/tom/Arbeit/Frontend-API-Client/node_modules/.bin:/home/tom/.local/bin:/opt/ros/foxy/bin:/home/tom/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle frontend-api-client#1.0.0~generate-client: CWD: /home/tom/Arbeit/Frontend-API-Client
10 silly lifecycle frontend-api-client#1.0.0~generate-client: Args: [ '-c',
10 silly lifecycle 'openapi --input http://0.0.0.0:8000/openapi.json --output ./src/client --client axios' ]
11 silly lifecycle frontend-api-client#1.0.0~generate-client: Returned: code: 1 signal: null
12 info lifecycle frontend-api-client#1.0.0~generate-client: Failed to exec generate-client script
13 verbose stack Error: frontend-api-client#1.0.0 generate-client: `openapi --input http://0.0.0.0:8000/openapi.json --output ./src/client --client axios`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid frontend-api-client#1.0.0
15 verbose cwd /home/tom/Arbeit/Frontend-API-Client
16 verbose Linux 5.13.0-40-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "generate-client"
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error frontend-api-client#1.0.0 generate-client: `openapi --input http://0.0.0.0:8000/openapi.json --output ./src/client --client axios`
22 error Exit status 1
23 error Failed at the frontend-api-client#1.0.0 generate-client script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Im currently trying to use the tutorial from FastAPI Generate Clients.
Can anybody help me?
NPM version was to old, in the end that was the only issue.

Error when using npm start for a react app

I created a react app folder using "create-react-app" it worked well and when I tried "npm start" to is throwing errors. I have uninstalled and reinstalled, I tried setting path in the environment variables. Whatever I try it the same error over and over again.
The Error Message
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\sreem\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.5
3 info using node#v14.3.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle movie#0.1.0~prestart: movie#0.1.0
6 info lifecycle movie#0.1.0~start: movie#0.1.0
7 verbose lifecycle movie#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle movie#0.1.0~start: PATH:
C:\Users\sreem\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\sreem\Desktop\movie\node_modules\.bin;C:\Python38\Scripts\;C:\Python38\;C:\Program Files\JetBrains\Intellij IDEA Community Edition 2019.1.3\plugins\Kotlin\kotlinc\bin;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk-14.0.1\bin;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.1\bin;;C:\Users\sreem\Documents\Microsoft VS Code\bin;C:\Users\sreem\AppData\Roaming\npm
9 verbose lifecycle movie#0.1.0~start: CWD: C:\Users\sreem\Desktop\movie
10 silly lifecycle movie#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle movie#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle movie#0.1.0~start: Failed to exec start script
13 verbose stack Error: movie#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous>
(C:\Users\sreem\AppData\Roaming\npm\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:\Users\sreem\AppData\Roaming\npm\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:1051:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid movie#0.1.0
15 verbose cwd C:\Users\sreem\Desktop\movie
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sreem\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v14.3.0
19 verbose npm v6.14.5
20 error code ELIFECYCLE
21 error errno 1
22 error movie#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the movie#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Having exit status 1 on react compilation with nextjs

Hi im having this error and i have no idea why it is... i did a lot of research but didnt find what i need.
I have next js and the script for npm run build is like this "next build"
and this issue is happening now over and over again.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.10.0
3 info using node#v12.7.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle start-p#1.0.0~prebuild: start-p#1.0.0
6 info lifecycle start-p#1.0.0~build: start-p#1.0.0
7 verbose lifecycle start-p#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle start-p#1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Rion\Desktop\InvisReact\invis\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Users\Rion\AppData\Local\Microsoft\WindowsApps;C:\Users\Rion\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Program Files\heroku\bin;C:\Users\Rion\AppData\Local\atom\bin;C:\Users\Rion\AppData\Roaming\Composer\vendor\bin;C:\Users\Rion\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle start-p#1.0.0~build: CWD: C:\Users\Rion\Desktop\InvisReact\invis
10 silly lifecycle start-p#1.0.0~build: Args: [ '/d /s /c', 'next build' ]
11 silly lifecycle start-p#1.0.0~build: Returned: code: 1 signal: null
12 info lifecycle start-p#1.0.0~build: Failed to exec build script
13 verbose stack Error: start-p#1.0.0 build: `next build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:203:13)
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:203:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid start-p#1.0.0
15 verbose cwd C:\Users\Rion\Desktop\InvisReact\invis
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v12.7.0
19 verbose npm v6.10.0
20 error code ELIFECYCLE
21 error errno 1
22 error start-p#1.0.0 build: `next build`
22 error Exit status 1
23 error Failed at the start-p#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 [ 1, true ]
Thank you.

how to debug node.js program from log message

I am new to server side programming and got some error message when tried to boost a node.js program(egg.js framework)
It is not that kind of bug that I made because of my certain line of code such as "undefined var xx ", I just don't know how to debug it from these messages
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\node\\node.exe',
1 verbose cli 'C:\\nvm\\nvm\\node_global\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#5.6.0
3 info using node#v8.10.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle blog-server#1.0.0~prestart: blog-server#1.0.0
6 info lifecycle blog-server#1.0.0~start: blog-server#1.0.0
7 verbose lifecycle blog-server#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle blog-server#1.0.0~start: PATH: C:\nvm\nvm\node_global\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\z\Desktop\Allen's-Blog\blog-server\node_modules\.bin;C:\Users\z\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\z\bin;C:\Program Files\ImageMagick-7.0.6-Q16;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Python27;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Java\jdk1.8.0_171\bin;C:\Program Files\Java\jdk1.8.0_171\jre\bin;D:\Software\gradle\bin;C:\nvm\nvm;C:\node;C:\nvm\nvm\node_global;C:\Program Files\Git\cmd;C:\Program Files\PuTTY;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MongoDB\Server\4.0\bin;C:\Program Files (x86)\SMLNJ\bin;C:\Users\z\AppData\Local\Programs\Python\Python35\Scripts;C:\Users\z\AppData\Local\Programs\Python\Python35;C:\Ruby24-x64\bin;C:\Users\z\AppData\Local\Microsoft\WindowsApps;node_global;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\nvm\nvm;C:\node;D:\Software\fiddle\Fiddler;D:\projects\Microsoft VS Code\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle blog-server#1.0.0~start: CWD: C:\Users\z\Desktop\Allen's-Blog\blog-server
10 silly lifecycle blog-server#1.0.0~start: Args: [ '/d /s /c',
10 silly lifecycle 'egg-scripts start --daemon --title=egg-server-blog-server' ]
11 silly lifecycle blog-server#1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle blog-server#1.0.0~start: Failed to exec start script
13 verbose stack Error: blog-server#1.0.0 start: `egg-scripts start --daemon --title=egg-server-blog-server`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\nvm\nvm\node_global\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:\nvm\nvm\node_global\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid blog-server#1.0.0
15 verbose cwd C:\Users\z\Desktop\Allen's-Blog\blog-server
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\node\\node.exe" "C:\\nvm\\nvm\\node_global\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v8.10.0
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error blog-server#1.0.0 start: `egg-scripts start --daemon --title=egg-server-blog-server`
22 error Exit status 1
23 error Failed at the blog-server#1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Use this command : console.log( <The variable you want to debug> ); when ever you want to debug something,
Exp :
var arr = [1,2,3,4,5];
for (let i in arr){
console.log(i);
}
There are plenty of other debugging tool and IDEs that can also help you (I recommend using VSCode, it's easy to use and have decent functionalities).

Exit status 1 npm-lifecycle\index.js:285:16

0 silly lifecycle stork.spa#1.0.0~build.prod: Args: [ '/d /s /c',
10 silly lifecycle 'gulp build.prod --color --env-config prod --build-type prod --base /cli/ --theme dark' ]
11 silly lifecycle stork.spa#1.0.0~build.prod: Returned: code: 1 signal: null
12 info lifecycle stork.spa#1.0.0~build.prod: Failed to exec build.prod script
13 verbose stack Error: stork.spa#1.0.0 build.prod: `gulp build.prod --color --env-config prod --build-type prod --base /cli/ --theme dark`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid stork.spa#1.0.0
15 verbose cwd C:\dev\JWT\Mvc\StorkCMS\Stork.SPA
16 verbose Windows_NT 10.0.17025
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build.prod"
18 verbose node v8.9.3
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error stork.spa#1.0.0 build.prod: `gulp build.prod --color --env-config prod --build-type prod --base /cli/ --theme dark`
22 error Exit status 1
23 error Failed at the stork.spa#1.0.0 build.prod script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
and in AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib there is no index.js only spawn.js
If you are using rxjs library, then make sure you change the value of
import { Observable } from 'rxjs/Rx';
to
import { Observable } from 'rxjs/observable';
across your workspace
And then make sure you revert/upgrade your typescript to v 2.3.4 and rxjs to 5.6.0. Do a npm clean cache and build again.
This worked for me. It seems there is some problem in compatibility of rxjs library and typescript versions.
Hope this helps.

Resources