Operating system: MacOS Mojave 10.14.2
ionic: 4.10.3
node: 10.15.2
npm: 6.4.1
When I am trying to create a new project the ionic or npm fails:
when giving the command:
sudo ionic start testApp blank --type=ionic-angular
> node-sass#4.11.0 postinstall /Users/international/Public/testApp/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /Users/international/Public/testApp/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/Users/international/Public/testApp/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 info using node-gyp#3.8.0
gyp info using node#10.15.2 | darwin | 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 "/usr/bin/python2.7" in the PATH
gyp verb `which` succeeded /usr/bin/python2.7 /usr/bin/python2.7
gyp verb check python version `/usr/bin/python2.7 -c "import sys; print "2.7.10
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.15.2
gyp verb command install [ '10.15.2' ]
gyp verb install input version string "10.15.2"
gyp verb install installing version: 10.15.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 10.15.2
gyp verb build dir attempting to create "build" dir: /Users/international/Public/testApp/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/international/Public/testApp/node_modules/node-sass/build'
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/bin/node" "/Users/international/Public/testApp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/international/Public/testApp/node_modules/node-sass
gyp ERR! node -v v10.15.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.11.0 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! /Users/international/.npm/_logs/2019-03-05T09_26_51_725Z-debug.log
[ERROR] An error occurred while running subprocess npm.
npm i exited with exit code 1.
Somewhere you will find "permission denied" as an error but in my command I used sudo as a prefix.
I have no clue what is happened and I tried many hours to find a solution to this. Also I am new user on MacOS
You need to change the ownership of the node_modules folder.
To change the permissions for the folder execute the following in the terminal:
sudo chown -R root:YOUR_USERNAME /Users/international/Public/testApp/node_modules/
sudo chmod -R 775 /Users/international/Public/testApp/node_modules/
If that doesn't work you can recursively set the permissions for your folder as follows:
sudo chmod 777 -R /Users/international/Public/testApp/
Related
For some reason my node package manager broke and I can't use it.
When running any install command I get a ton of error messages which I have no clue how to fix them.
I am quite new to node so forgive me if this might be straight forward but I couldn't fix it with a Google search. I should note that I have completely reinstalled npm and nodejs.
How do I fix this?
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /var/www/dev/ivrm/wp-content/themes/roots/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh /tmp/postinstall-34823128.sh
npm ERR! Building: /usr/bin/node /var/www/dev/ivrm/wp-content/themes/roots/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! make: Entering directory '/var/www/dev/ivrm/wp-content/themes/roots/node_modules/node-sass/build'
npm ERR! make: Leaving directory '/var/www/dev/ivrm/wp-content/themes/roots/node_modules/node-sass/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/usr/bin/node',
npm ERR! gyp verb cli '/var/www/dev/ivrm/wp-content/themes/roots/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#7.1.2
npm ERR! gyp info using node#18.6.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - executable path is "/usr/bin/python3"
npm ERR! gyp verb find Python - executing "/usr/bin/python3" to get version
npm ERR! gyp verb find Python - version is "3.8.10"
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 18.6.0
npm ERR! gyp verb command install [ '18.6.0' ]
npm ERR! gyp verb install input version string "18.6.0"
npm ERR! gyp verb install installing version: 18.6.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 18.6.0
npm ERR! make: Leaving directory '/var/www/dev/ivrm/wp-content/themes/roots/node_modules/node-sass/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli '/usr/bin/node',
npm ERR! gyp verb cli '/var/www/dev/ivrm/wp-content/themes/roots/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#7.1.2
npm ERR! gyp info using node#18.6.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - executable path is "/usr/bin/python3"
npm ERR! gyp verb find Python - executing "/usr/bin/python3" to get version
npm ERR! gyp verb find Python - version is "3.8.10"
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 18.6.0
npm ERR! gyp verb command install [ '18.6.0' ]
npm ERR! gyp verb install input version string "18.6.0"
npm ERR! gyp verb install installing version: 18.6.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 18.6.0
(Unfortunately I can't paste my entire error log in here, I hope this is enough)
I have a problem while creating my project with vue.js, wanting to start to take in hands this framework, I find myself facing a wall. The problem is that every time I enter the following command line in the windows command prompt I get this error:
(c) Microsoft Corporation. Tous droits réservés.
C:\WINDOWS\system32>vue --version
#vue/cli 4.5.15
C:\WINDOWS\system32>vue create other-one
Vue CLI v4.5.15
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, CSS Pre-processors, Linter
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with node-sass)
? Pick a linter / formatter config: Basic
? Pick additional lint features: Lint on save
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? No
Vue CLI v4.5.15
✨ Creating project in C:\WINDOWS\system32\other-one.
🗃 Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...
added 1277 packages, and audited 1278 packages in 2m
85 packages are looking for funding
run `npm fund` for details
28 vulnerabilities (17 moderate, 11 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
🚀 Invoking generators...
📦 Installing additional dependencies...
npm ERR! code 1
npm ERR! path C:\WINDOWS\system32\other-one\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\WINDOWS\system32\other-one\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! MSBUILD : error MSB1009: Le fichier projet n'existe pas.
npm ERR! Commutateur�:�build/binding.sln
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli 'C:\\WINDOWS\\system32\\other-one\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp#3.8.0
npm ERR! gyp info using node#16.13.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "C:\Users\kevin\.windows-build-tools\python27\python.exe" in the PATH
npm ERR! gyp verb `which` succeeded C:\Users\kevin\.windows-build-tools\python27\python.exe C:\Users\kevin\.windows-build-tools\python27\python.exe
npm ERR! gyp verb check python version `C:\Users\kevin\.windows-build-tools\python27\python.exe -c "import sys; print "2.7.15
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 16.13.1
npm ERR! gyp verb command install [ '16.13.1' ]
npm ERR! gyp verb install input version string "16.13.1"
npm ERR! gyp verb install installing version: 16.13.1
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 16.13.1
npm ERR! gyp verb build dir attempting to create "build" dir: C:\WINDOWS\system32\other-one\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? C:\WINDOWS\system32\other-one\node_modules\node-sass\build
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: C:\WINDOWS\system32\other-one\node_modules\node-sass\build\config.gypi
npm ERR! (node:2840) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp verb config.gypi checking for gypi file: C:\WINDOWS\system32\other-one\node_modules\node-sass\config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: C:\WINDOWS\system32\other-one\node_modules\node-sass\common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:\Users\kevin\.windows-build-tools\python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\WINDOWS\\system32\\other-one\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-G',
npm ERR! gyp info spawn args 'msvs_version=2015',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\WINDOWS\\system32\\other-one\\node_modules\\node-sass\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\WINDOWS\\system32\\other-one\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\kevin\\.node-gyp\\16.13.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\kevin\\.node-gyp\\16.13.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\WINDOWS\\system32\\other-one\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\kevin\\.node-gyp\\16.13.1\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\WINDOWS\\system32\\other-one\\node_modules\\node-sass',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\WINDOWS\\system32\\other-one\\node_modules\\node-sass\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir C:\Users\kevin\.node-gyp\16.13.1
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb could not find "msbuild.exe" in PATH - finding location in registry
npm ERR! gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\WINDOWS\system32\other-one\node_modules\node-gyp\lib\build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\WINDOWS\\system32\\other-one\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\WINDOWS\system32\other-one\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kevin\AppData\Local\npm-cache\_logs\2022-01-04T22_59_04_505Z-debug.log
ERROR command failed: npm install --loglevel error --legacy-peer-deps
I tried the npm cache clean --force then manually delete node_modules and package-lock.json and npm i. Doesn't work.
I also tried to change my python version and change it in my enviromental variables. Not working too.
Last step was to delete node and install last version (17.3.0) either the (16.13.1) and an other version from 14 release. Nothing seems to work.
So if anybody got an answer ... Please...
Thanks for reading it, even if you don't have any answer.
The first thing you need to know is that different versions correspond to different uses
node corresponding node-sass
node-sass corresponding sass-loader
sass-loader 4.1.1,node-sass 4.3.0
sass-loader 7.0.3,node-sass 4.7.2
sass-loader 7.3.1,node-sass 4.7.2
sass-loader 7.3.1,node-sass 4.14.1
the sloution 1
if your node 16+
1-1、uninstall
npm uninstall node-sass --save
npm uninstall sass-loader --save
1-2、install
npm i node-sass#6.0.1 -S
npm i sass-loader#10.0.1 -S
else if your node less than 16, You can install according to the above version
the sloution 2(recommend)
use dart-sass
1-1、uninstall
npm uninstall node-sass --save
npm uninstall sass-loader --save
1-2、install
npm i sass#1.32 -S
npm i sass-loader#10.0.5 -S
Delete node_modules folder and package-lock.json, and delete the file .npmrc in your C:\Users\your name, run npm install again.
You're trying to create a project the C:\WINDOWS\system32 directory. This is a Windows folder and shouldn't be use (and has more security restrictions than a folder owned by your own user).
Switch to a folder that belongs to your user, such as a folder on your Desktop, and try again.
Here are the few steps to follow to fix it up:)
Delete node_modules folder and delete package-lock.json
npm install
finally npm run serve
Please use yarn instead of npm.
ex:
Delete node_modules folder and package-lock.json.
Run cmd and input
yarn
yarn start
I hope you solve the problem.
Thank you for your watching my answer.
I was trying to install node-sass on Linux Mint by running the command sudo npm install node-sass, but I got some errors. It says that it does not have access to some directories, which doesn't make any sense because I ran it with sudo. I have tried many solutions on StackOverflow, including purging node, using a different version, etc. but none have worked. Here is the full terminal log:
> node-sass#4.9.3 install /home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass
> node scripts/install.js
Unable to save binary /home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync (/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/mkdirp/index.js:71:13)
at Function.sync (/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass/vendor' }
> node-sass#4.9.3 postinstall /home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/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 info using node-gyp#3.8.0
gyp info using node#8.11.0 | linux | 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 "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.12
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 8.11.0
gyp verb command install [ '8.11.0' ]
gyp verb install input version string "8.11.0"
gyp verb install installing version: 8.11.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.11.0
gyp verb build dir attempting to create "build" dir: /home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass/build'
gyp ERR! System Linux 4.10.0-37-generic
gyp ERR! command "/usr/local/bin/node" "/home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/caden/Desktop/Infinite_Robots_Work/infinite-robots-homepage/infinite-robots-homepage/node_modules/node-sass
gyp ERR! node -v v8.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN ajv-keywords#3.2.0 requires a peer of ajv#^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.3 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! /home/caden/.npm/_logs/2018-08-10T00_32_24_558Z-debug.log
Try Using The following, Source
sudo npm install --unsafe-perm -g node-sass
Try using the following command
npm install -f node-sass
Try this
npm i --unsafe-perm node-sass
I encountered the same error, after I upgraded node.
I tested all these solutions. Unfortunately no one help me.
But this one did:
npm rebuild node-sass
i have an angular 4 app and i want to run it on ubuntu. i copied all project files , package.json and package-lock.json to a folder in winscp but i didn't copy node_modules! now when i run npm install, i get the errors like this:
> node-sass#4.7.2 install /home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass
> node scripts/install.js
Unable to save binary /home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync (/home/ubuntu/cms/node_modules/mkdirp/index.js:71:13)
at Function.sync (/home/ubuntu/cms/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass/scripts/install.js:111:11)
at Object.<anonymous> (/home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass/scripts/install.js:154:1)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass/vendor' }
> node-sass#4.9.1 install /home/ubuntu/cms/node_modules/node-sass
> node scripts/install.js
Unable to save binary /home/ubuntu/cms/node_modules/node-sass/vendor/linux-x64-57 : { Error: EACCES: permission denied, mkdir '/home/ubuntu/cms/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:885:18)
at sync (/home/ubuntu/cms/node_modules/mkdirp/index.js:71:13)
at Function.sync (/home/ubuntu/cms/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/home/ubuntu/cms/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/home/ubuntu/cms/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/home/ubuntu/cms/node_modules/node-sass/vendor' }
> node-sass#4.7.2 postinstall /home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass
> node scripts/build.js
Building: /usr/bin/node /home/ubuntu/cms/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli '/home/ubuntu/cms/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 info using node-gyp#3.7.0
gyp info using node#8.9.4 | linux | 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 "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.9.4
gyp verb command install [ '8.9.4' ]
gyp verb install input version string "8.9.4"
gyp verb install installing version: 8.9.4
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.9.4
gyp verb build dir attempting to create "build" dir: /home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass/build'
gyp ERR! System Linux 4.4.0-124-generic
gyp ERR! command "/usr/bin/node" "/home/ubuntu/cms/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/ubuntu/cms/node_modules/#angular/cli/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Build failed with error code: 1
> node-sass#4.9.1 postinstall /home/ubuntu/cms/node_modules/node-sass
> node scripts/build.js
Building: /usr/bin/node /home/ubuntu/cms/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli '/home/ubuntu/cms/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 info using node-gyp#3.7.0
gyp info using node#8.9.4 | linux | 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 "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.9.4
gyp verb command install [ '8.9.4' ]
gyp verb install input version string "8.9.4"
gyp verb install installing version: 8.9.4
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.9.4
gyp verb build dir attempting to create "build" dir: /home/ubuntu/cms/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ubuntu/cms/node_modules/node-sass/build'
gyp ERR! System Linux 4.4.0-124-generic
gyp ERR! command "/usr/bin/node" "/home/ubuntu/cms/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/ubuntu/cms/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.7.2 (node_modules/#angular/cli/node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.7.2 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.1 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! /home/ubuntu/.npm/_logs/2018-07-07T10_49_32_298Z-debug.log
i did the steps that i said before to run my project, but i don't know whats going on here now?
i also did rm -rf node_modules, rm package-lock.json, npm cache clean --force and used npm install again but it's still not working!
Add --unsafe-perm flag while installing
For linux/mac
sudo npm install --unsafe-perm -g node-sass
For windows environment , hit same command removing sudo
On Linux/mac
npm install --unsafe-perm node-sass
Just adding unsafe-perm would work. Using sudo would give unnecessary permissions to node modules and mess things with the file system.
I am new to NodeJS and I am trying to install node saas by sudo npm install -g --unsafe-perms node-sass
and I see this
/usr/local/bin/node-sass -> /usr/local/lib/node_modules/node-sass/bin/node-sass
> node-sass#4.7.2 install /usr/local/lib/node_modules/node-sass
> node scripts/install.js
Unable to save binary /usr/local/lib/node_modules/node-sass/vendor/linux-x64-59 : { Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:905:18)
at sync (/usr/local/lib/node_modules/node-sass/node_modules/mkdirp/index.js:71:13)
at Function.sync (/usr/local/lib/node_modules/node-sass/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/usr/local/lib/node_modules/node-sass/scripts/install.js:111:11)
at Object.<anonymous> (/usr/local/lib/node_modules/node-sass/scripts/install.js:154:1)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/local/lib/node_modules/node-sass/vendor' }
> node-sass#4.7.2 postinstall /usr/local/lib/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /usr/local/lib/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/usr/local/lib/node_modules/node-sass/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 info using node-gyp#3.6.2
gyp info using node#9.4.0 | linux | 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 "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 9.4.0
gyp verb command install [ '9.4.0' ]
gyp verb install input version string "9.4.0"
gyp verb install installing version: 9.4.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 9.4.0
gyp verb build dir attempting to create "build" dir: /usr/local/lib/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/node-sass/build'
gyp ERR! System Linux 4.13.0-32-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/node-sass
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.7.2 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! /home/baig772/.npm/_logs/2018-02-14T18_01_56_774Z-debug.log
sudo chown -R $USER:admin /usr/local