Search code examples
node.jsangularnpmnpm-installnode-sass

How to solve error with node-sass install script


I'm trying to start a new Angular project, but I keep running into the same error where node-sass@4.13.0 fails to install.

Screenshot after running npm install.

After reading similar questions, I tried both running npm install node-sass@latest and changing node versions, but neither solved the issue.

For more information, the error log states this:

2213 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
2214 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
2216 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 (node_modules\@angular-devkit\build-angular\node_modules\node-sass):
2217 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 install: `node scripts/install.js`
2217 warn optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
2218 verbose optional SKIPPING OPTIONAL DEPENDENCY:
2218 verbose optional Failed at the node-sass@4.12.0 install script.
2218 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
2219 verbose stack Error: node-sass@4.13.0 install: `node scripts/install.js`
2219 verbose stack Exit status 1
2219 verbose stack     at EventEmitter.<anonymous> (C:\ProgramData\nvm\v10.15.3\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
2219 verbose stack     at EventEmitter.emit (events.js:189:13)
2219 verbose stack     at ChildProcess.<anonymous> (C:\ProgramData\nvm\v10.15.3\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2219 verbose stack     at ChildProcess.emit (events.js:189:13)
2219 verbose stack     at maybeClose (internal/child_process.js:970:16)
2219 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
2220 verbose pkgid node-sass@4.13.0
2221 verbose cwd C:\Users\xdani\Desktop\Angular\strive-with-me
2222 verbose Windows_NT 10.0.17763
2223 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass@latest"
2224 verbose node v10.15.3
2225 verbose npm  v6.4.1
2226 error code ELIFECYCLE
2227 error errno 1
2228 error node-sass@4.13.0 install: `node scripts/install.js`
2228 error Exit status 1
2229 error Failed at the node-sass@4.13.0 install script.
2229 error This is probably not a problem with npm. There is likely additional logging output above.
2230 verbose exit [ 1, true ]

Any suggestions?

Thanks, really appreciate your time!


Solution

  • Check:-

    1) node --version
    2) ng --version
    3) npm --version
    

    If node is not there, go to https://nodejs.org/en/download/ and download it close terminal and run "npm install"

    Try:-

    1) npm cache clean --force
    or,
    1) npm cache verify --force
    
    2) Delete node_modules
    3) kill terminal
    4) npm install
    

    if it didn't worked,

    Try npm install --unsafe-perm