位 npm install
[email protected] install C:varwwwproject-dirnode_modulesnode-sass
node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.9.3/win32-x64-72_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
[email protected] postinstall C:varwwwproject-dirnode_modulesnode-sass
node scripts/build.js
Building: C:Program Filesnodejsnode.exe C:varwwwproject-dirnode_modulesnode-gypbinnode-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\Program Files\nodejs\node.exe',
gyp verb cli 'C:\var\www\project-dir\node_modules\node-gyp\bin\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "C:Python37python.exe" in the PATH
gyp verb which succeeded C:Python37python.exe C:Python37python.exe
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:Python37python.exe -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:297:12)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\var\www\project-dir\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:varwwwproject-dirnode_modulesnode-sass
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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:UsersUserNameAppDataRoamingnpm-cache_logs2020-03-12T13_15_02_615Z-debug.log
位 npm -v
6.14.2
位 node -v
v12.6.0
node-gyp -v v3.8.0
gyp ERR! not ok
https://github.com/nodejs/node-gyp/releases
node-gyp -v v3.8.0
gyp ERR! not ok
https://github.com/nodejs/node-gyp/releases
I didn't get your point, what are you trying to say.
node-gyp v3.8.0 vs. the current v6.1.0
I have upgraded it via https://github.com/nodejs/node-gyp/wiki/Updating-npm's-bundled-node-gyp
位 npm install -g node-gyp@latest
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
C:UsersUserNameAppDataRoamingnpmnode-gyp -> C:UsersUserNameAppDataRoamingnpmnode_modulesnode-gypbinnode-gyp.js
then I run again same command npm install
but it's still showing following error gyp ERR! node-gyp -v v3.8.0
@cclauss Thanks for help, issue solved by deleting the node_modules directory and package-lock.json, then run command npm install.
npm install -g --unsafe-perm node-sass --save work for me
Oh yes, deleting package.lock and re-running npm install does it.
But I also had to have python2 installed and in the path.
I also had to have python2 installed and in the path.
You can force the use of a particular version with the __--python__ command line option.
@cclauss thanks,
It worked! Is there an article that explains the issue in details.
Most helpful comment
@cclauss Thanks for help, issue solved by deleting the
node_modulesdirectory andpackage-lock.json, then run commandnpm install.