How to load the Visual C++ component "VCBuild.exe"? - node.js

I tried to run "VCBuild.exe"
My environment:
Windows 10 Pro X64
node v7.9.0-x64
Visual Studio 2017
So,I've just run like this command.
$npm install --global --production windows-build-tools
But it doesn't work.
Errors are bellow:
> windows-build-tools#1.2.1 postinstall C:\Users\Josephine\AppData\Roaming\npm\n ode_modules\windows-build-tools
> node ./lib/index.js
Downloading BuildTools_Full.exe
[> ] 0.0% (0 B/s)
Downloading python-2.7.11.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.11.msi. Saved to C:\Users\Josephine\.windows-build-tools\p ython-2.7.11.msi.
Starting installation...
Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".
npm WARN Error: EPERM: operation not permitted, scandir 'C:\Users\Josephine\AppD ata\Roaming\npm\node_modules\windows-build-tools\node_modules'
npm WARN { Error: EPERM: operation not permitted, scandir 'C:\Users\Josephine\A ppData\Roaming\npm\node_modules\windows-build-tools\node_modules'
npm WARN errno: -4048,
npm WARN code: 'EPERM',
npm WARN syscall: 'scandir',
npm WARN path: 'C:\\Users\\Josephine\\AppData\\Roaming\\npm\\node_modules\\win dows-build-tools\\node_modules' }
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows -build-tools"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools#1.2.1 postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools#1.2.1 postinstall script 'node ./lib/ index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools p ackage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Josephine\AppData\Roaming\npm-cache\_logs\2017-04-26T17_33 _28_317Z-debug.log
how can i fix them?

The output says exactly what you need to do:
Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".
If you run PowerShell (or the Command Prompt you used to run npm) as Administrator, then it should work.

Related

NPM ERR! When trying to run Meteor project

I'm trying to view someone else's Meteor project from Github. I cloned it then tried running it by typing 'meteor' but what results is this slew of errors. I've included a sample below. I am running the command prompt as administrator. Clearly this has something to do with Node or its packages but I'm at a loss of where I should go with this. If someone could give me a hint I would be grateful.
npm http GET https://registry.npmjs.org/camelcase
npm http GET https://registry.npmjs.org/map-obj
npm http 304 https://registry.npmjs.org/mime-db
npm http GET https://registry.npmjs.org/get-stdin
npm http GET https://registry.npmjs.org/repeating
npm http 304 https://registry.npmjs.org/async
etc. etc....
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path:
'C:\Users\Kyle\Documents\Websites...
npm ERR! 'Object.oncomplete (fs.js:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\\node.exe"
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-
os.windows.x86_32\dev_bundle\bin\node_modules\npm\bin\npm-cli.js"
"install"
npm ERR! cwd
C:\Users\Kyle\Documents\Websites\thisWebsite\packages\npm-container.npm\package-new-14v2dj3
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chmod
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack
C:\Users\Kyle\AppData\Local.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\node_modules\npm\node_modules\fstream\lib\writer.js:305:19
npm ERR! fstream_type Directory npm
ERR! fstream_class DirWriter
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error:
EPERM, mkdir
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.9
npm ERR! path...
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15)
npm ERR!
Error: version not found: ansi-styles#2.2.0
npm ERR! at
C:\Users\Kyle\AppData\Local.meteor\packages\meteor-tool\1.1.10...
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Windows_NT 6.2.9200
npm ERR! command
"C:\Users\Kyle\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\bin\\node.exe"
Try running the CMD / Powershell with Administrator (Run as Administrator). and then install npm dependencies as Github usually don't store them do: npm install and npm start. If you keep getting the errors. go to C:\Program Files\nodejs\node_modules\
or where your nodejs is installed and do right click, choose 'Properties' and go to 'Security' tab and give privileges to the user you need and try running npm install. Good luck
This worked in my particular case:
Remove meteorhacks and npm-container by typing this in the console:
meteor remove meteorhacks:npm npm-container
Delete the 'npm-container' folder which is generated by the package.
Run 'npm init' to create a package.json
Copy the contents of packages.json to the dependencies section of package.json

Is it safe to use npm install with --force on production?

we are facing an interesting problem in our build server that prevents our app to install npm dependencies which causes most of our builds to fail.
We are using the build server Visual Studio Team Services which runs Windows. When we are trying to install npm dependencies we get the following error:
2016-04-13T12:44:25.0931743Z npm ERR! Windows_NT 6.3.9600
2016-04-13T12:44:25.0931743Z npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
2016-04-13T12:44:25.0941742Z npm ERR! node v0.12.7
2016-04-13T12:44:25.0941742Z npm ERR! npm v2.11.3
2016-04-13T12:44:25.0951737Z npm ERR! path C:\NPM\Cache\repeating\1.1.3\package\package.json
2016-04-13T12:44:25.0951737Z npm ERR! code EPERM
2016-04-13T12:44:25.0951737Z npm ERR! errno -4048
2016-04-13T12:44:25.0981746Z npm ERR! Error: EPERM, rename 'C:\NPM\Cache\repeating\1.1.3\package\package.json'
2016-04-13T12:44:25.0991748Z npm ERR! at Error (native)
2016-04-13T12:44:25.0991748Z npm ERR! { [Error: EPERM, rename 'C:\NPM\Cache\repeating\1.1.3\package\package.json']
2016-04-13T12:44:25.1001741Z npm ERR! errno: -4048,
2016-04-13T12:44:25.1001741Z npm ERR! code: 'EPERM',
2016-04-13T12:44:25.1011746Z npm ERR! path: 'C:\\NPM\\Cache\\repeating\\1.1.3\\package\\package.json',
2016-04-13T12:44:25.1011746Z npm ERR! parent: 'babel-traverse' }
2016-04-13T12:44:25.1021741Z npm ERR!
2016-04-13T12:44:25.1021741Z npm ERR! Please try running this command again as root/Administrator.
2016-04-13T12:44:28.0020021Z npm ERR! Please include the following file with any support request:
2016-04-13T12:44:28.0029943Z npm ERR! C:\a\1\s\src\OrderEze.Web\npm-debug.log
2016-04-13T12:44:28.1069958Z ##[debug]rc:4294963248
2016-04-13T12:44:28.1079955Z Npm failed with error: C:\Program Files\nodejs\npm.cmd failed with return code: 4294963248
We found that if we try to install our dependencies using the force command, everything works fine:
npm install --force
My question is simple. Will we have any issues with this configuration? Why npm warns us about this command? Any idea can help :)

Can't Install lessc using NPM on mac

I was trying to install lessc globally on my mac, I installed node.js from their website, and when I run the command (npm install -g less) I get this, could you please help me, all I want to do is to install Less and get the less2css compiler on sublimetext 3 work properly:
npm install -g less
npm WARN locking Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock'
npm WARN locking at Error (native)
npm WARN locking /Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock failed { [Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock']
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock' }
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "less"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! Attempt to unlock /usr/local/lib/node_modules/less, which hasn't been locked
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Mohammad/npm-debug.log
MacBook-Pro:~ Mohammad$ npm install -g less
npm WARN locking Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock'
npm WARN locking at Error (native)
npm WARN locking /Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock failed { [Error: EACCES, open '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock']
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking path: '/Users/Mohammad/.npm/_locks/less-c2213c903e2e7354.lock' }
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "less"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! Attempt to unlock /usr/local/lib/node_modules/less, which hasn't been locked
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Mohammad/npm-debug.log
You need to execute this command as superuser if you do not have write permissions on the /usr/local directory.
Please try:
sudo npm install -g less

NPM installation issues on Mac OS Mavericks

I am trying to get to grips with AngularJS, NodeJS and Ruby on Rails. When trying to install npm packages like yeoman, grunt etc. I receive an error in my Terminal which I have listed below:
npm ERR! Error: EACCES, open '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961'
npm ERR! { [Error: EACCES, open '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961',
npm ERR! parent: 'browserify' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "browserify"
npm ERR! cwd /Users/Jabane
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.16
npm ERR! path /Users/Jabane/.npm/glob/3.2.11/package/package.json.25961
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/Jabane/.npm/glob/3.2.11/package/package.json.25961'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/kJabane/npm-debug.log
npm ERR! not ok code 0
What might be the issue in this case? Your assistance is highly appreciated.
Thanks
This is a permissions issue. You need to prefix your npm install command with sudo, e.g.:
sudo npm install yeoman
It will prompt you for your User Account's password; and subject to the correct password being provided, will then install the packages correctly.

"sudo npm install -g grunt-cli" gives me an error

I get an error when trying to install gruntjs on a linux 12.04 (with a mirrored packages source)
Here is the error:
sudo npm install -g grunt-cli
npm ERR! Error: ENOENT, open '/home/havetl/.npm/d63f3d0b-grunt-cli.lock'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /home/havetl
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! path /home/havetl/.npm/d63f3d0b-grunt-cli.lock
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR! { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /home/havetl
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/havetl/npm-debug.log
npm ERR! not ok code 0
Thanks for any idea!
According to the maintainer of npm, installing packages with sudo is considered bad practice because you are allowing that package to have complete control of your system and you can't and SHOULDN'T trust these packages with root access. Think Debian's long release cycles as an extreme example of protecting end users from community maintained packages for this exact reason.
http://howtonode.org/introduction-to-npm
You should do what Issaacs suggests and chown your /usr/local folder so you have RW permissions.
I've had this problem before; sometimes for global packages your current working directory has to be ~/ (but I'm not sure why this is!). Try:
cd ~/; sudo npm install -g grunt-cli
This blog worked for me :
http://slopjong.de/2012/10/31/how-to-install-the-latest-nodejs-in-ubuntu/
the error was because in ubuntu v12 few of the dependencies were not available for the latest version of Node.

Resources