bigcommerce / widget-builder

MIT License
18 stars 39 forks source link

npm run install-cli error #94

Closed arosesiejdev closed 7 months ago

arosesiejdev commented 2 years ago

I am following the documentation instructions. I have cloned this repo, navigated to the widget-builder directory and can confirm I am using Node version 14.0.0 and NPM 16.4.

Upon trying to run the command below npm run install-cli

I get the following error in the console

arose@DESKTOP-XXXXXX MINGW64 ~/Desktop/widget-builder (master)
$ npm run install-cli

> widget-builder@0.0.1 install-cli C:\Users\arose\Desktop\widget-builder
> npm install; npm run build && npm install -g

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    C:\Users\arose\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@6.14.4 C:\Users\arose\AppData\Roaming\nvm\v14.0.0\node_modules\npm

Did you mean one of these?
    install
    uninstall
    unstar
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! widget-builder@0.0.1 install-cli: `npm install; npm run build && npm install -g`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the widget-builder@0.0.1 install-cli 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\arose\AppData\Roaming\npm-cache\_logs\2022-03-28T18_45_22_833Z-debug.log

Below is the full log file:

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   'install-cli'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v14.0.0
4 verbose run-script [ 'preinstall-cli', 'install-cli', 'postinstall-cli' ]
5 info lifecycle widget-builder@0.0.1~preinstall-cli: widget-builder@0.0.1
6 info lifecycle widget-builder@0.0.1~install-cli: widget-builder@0.0.1
7 verbose lifecycle widget-builder@0.0.1~install-cli: unsafe-perm in lifecycle true
8 verbose lifecycle widget-builder@0.0.1~install-cli: PATH: C:\Users\arose\AppData\Roaming\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\arose\Desktop\widget-builder\node_modules\.bin;C:\Users\arose\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\arose\bin;C:\Program Files\Oculus\Support\oculus-runtime;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\Intel\Intel(R) Memory and Storage Tool;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;%NVM_HOME%;%NVM_SYMLINK%;C:\Users\arose\AppData\Local\Microsoft\WindowsApps;C:\Users\arose\AppData\Local\GitHubDesktop\bin;C:\Users\arose\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\arose\AppData\Roaming\npm;C:\Users\arose\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle widget-builder@0.0.1~install-cli: CWD: C:\Users\arose\Desktop\widget-builder
10 silly lifecycle widget-builder@0.0.1~install-cli: Args: [ '/d /s /c', 'npm install; npm run build && npm install -g' ]
11 silly lifecycle widget-builder@0.0.1~install-cli: Returned: code: 1  signal: null
12 info lifecycle widget-builder@0.0.1~install-cli: Failed to exec install-cli script
13 verbose stack Error: widget-builder@0.0.1 install-cli: `npm install; npm run build && npm install -g`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\arose\AppData\Roaming\nvm\v14.0.0\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\arose\AppData\Roaming\nvm\v14.0.0\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 widget-builder@0.0.1
15 verbose cwd C:\Users\arose\Desktop\widget-builder
16 verbose Windows_NT 10.0.19044
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "install-cli"
18 verbose node v14.0.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error widget-builder@0.0.1 install-cli: `npm install; npm run build && npm install -g`
22 error Exit status 1
23 error Failed at the widget-builder@0.0.1 install-cli script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
pieterdnz commented 2 years ago

this happened to me to i am guessing u are on windows (and sometime they forget that not everyone is on a mac) this is what i did

add this to the scripts section in the package.json

    "preinstall-cli-win": "npm install",
    "install-cli-win": "npm run build && npm install -g",

and then run:

npm run install-cli-win

arosesiejdev commented 2 years ago

this happened to me to i am guessing u are on windows (and sometime they forget that not everyone is on a mac) this is what i did

add this to the scripts section in the package.json

    "preinstall-cli-win": "npm install",
    "install-cli-win": "npm run build && npm install -g",

and then run:

npm run install-cli-win

Hey thanks for replying. @pieterdnz I tried that and getting this error in my log file now

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   'install-cli-win'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v14.0.0
4 verbose run-script [ 'preinstall-cli-win', 'install-cli-win', 'postinstall-cli-win' ]
5 info lifecycle widget-builder@0.0.1~preinstall-cli-win: widget-builder@0.0.1
6 verbose lifecycle widget-builder@0.0.1~preinstall-cli-win: unsafe-perm in lifecycle true
7 verbose lifecycle widget-builder@0.0.1~preinstall-cli-win: PATH: C:\Users\arose\AppData\Roaming\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\arose\Desktop\widget-builder\node_modules\.bin;C:\Users\arose\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\arose\bin;C:\Program Files\Oculus\Support\oculus-runtime;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\Intel\Intel(R) Memory and Storage Tool;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\arose\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\arose\AppData\Local\Microsoft\WindowsApps;C:\Users\arose\AppData\Local\GitHubDesktop\bin;C:\Users\arose\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\arose\AppData\Roaming\npm;C:\Users\arose\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
8 verbose lifecycle widget-builder@0.0.1~preinstall-cli-win: CWD: C:\Users\arose\Desktop\widget-builder
9 silly lifecycle widget-builder@0.0.1~preinstall-cli-win: Args: [ '/d /s /c', 'npm install' ]
10 silly lifecycle widget-builder@0.0.1~preinstall-cli-win: Returned: code: 0  signal: null
11 info lifecycle widget-builder@0.0.1~install-cli-win: widget-builder@0.0.1
12 verbose lifecycle widget-builder@0.0.1~install-cli-win: unsafe-perm in lifecycle true
13 verbose lifecycle widget-builder@0.0.1~install-cli-win: PATH: C:\Users\arose\AppData\Roaming\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\arose\Desktop\widget-builder\node_modules\.bin;C:\Users\arose\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\arose\bin;C:\Program Files\Oculus\Support\oculus-runtime;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\Program Files\Intel\Intel(R) Memory and Storage Tool;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\arose\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\arose\AppData\Local\Microsoft\WindowsApps;C:\Users\arose\AppData\Local\GitHubDesktop\bin;C:\Users\arose\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\arose\AppData\Roaming\npm;C:\Users\arose\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
14 verbose lifecycle widget-builder@0.0.1~install-cli-win: CWD: C:\Users\arose\Desktop\widget-builder
15 silly lifecycle widget-builder@0.0.1~install-cli-win: Args: [ '/d /s /c', 'npm run build && npm install -g' ]
16 silly lifecycle widget-builder@0.0.1~install-cli-win: Returned: code: 2  signal: null
17 info lifecycle widget-builder@0.0.1~install-cli-win: Failed to exec install-cli-win script
18 verbose stack Error: widget-builder@0.0.1 install-cli-win: `npm run build && npm install -g`
18 verbose stack Exit status 2
18 verbose stack     at EventEmitter.<anonymous> (C:\Users\arose\AppData\Roaming\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
18 verbose stack     at EventEmitter.emit (events.js:315:20)
18 verbose stack     at ChildProcess.<anonymous> (C:\Users\arose\AppData\Roaming\nvm\v14.0.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
18 verbose stack     at ChildProcess.emit (events.js:315:20)
18 verbose stack     at maybeClose (internal/child_process.js:1051:16)
18 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
19 verbose pkgid widget-builder@0.0.1
20 verbose cwd C:\Users\arose\Desktop\widget-builder
21 verbose Windows_NT 10.0.19044
22 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "install-cli-win"
23 verbose node v14.0.0
24 verbose npm  v6.14.4
25 error code ELIFECYCLE
26 error errno 2
27 error widget-builder@0.0.1 install-cli-win: `npm run build && npm install -g`
27 error Exit status 2
28 error Failed at the widget-builder@0.0.1 install-cli-win script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 2, true ]
eli-alvarado commented 2 years ago

hey @arosesiejdev I was running into the same issue on Windows - I followed what @pieterdnz suggested and got it to work. Just wanted to make sure that when you are adding the lines of code that Pieter posted, you're adding it in the package.json file in the widget-builder directory, not the website root package.json file. Hope this helps!

GoodNightBuddy commented 1 year ago

What worked for me was changing the script like this: "install-cli": "npm install && npm run build && npm install -g"

christensenep commented 7 months ago

Fixed via https://github.com/bigcommerce/widget-builder/pull/131, thank you for reporting the issue and apologies for the wait.