I have a nodejs docker instance running in Windows.
I have mounted a write-enabled windows directory to the docker instance.
I am trying to install shelljs into my project but it is failing with a following error:
npm ERR! Linux 4.0.9-boot2docker
npm ERR! argv "/opt/nodejs/bin/node" "/usr/bin/npm" "install" "shelljs"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! path ../shelljs/bin/shjs
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../shelljs/bin/shjs' -> '/home/app/meteor-webpack-react/node_modules/.bin/shjs'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Linux 4.0.9-boot2docker
npm ERR! argv "/opt/nodejs/bin/node" "/usr/bin/npm" "install" "shelljs"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! path npm-debug.log.907b6eb81436ba935104c98d206fb37c
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename 'npm-debug.log.907b6eb81436ba935104c98d206fb37c' -> 'npm-debug.log'
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! /home/app/meteor-webpack-react/npm-debug.log
Please note that I have enabled symlink creation (http://www.ahtik.com/blog/fixing-your-virtualbox-shared-folder-symlink-error/) and they can be done manually via ln -s. I am running a machine as administrator.
Any idea of why the symlinks are failing. I thought that it is because the npm cache is in the virtual machine trying to symlink to windows directory, but trying to move cache to windows directory failed as well (npm config set cache ~/.npm --global)
Have you made sure you have installed Virtualbox Extension Pack for the right version of VirtualBox? Usually that is the culprit.
Related
I want to install gulp globally,so I use this command ,
npm install gulp -g
then throw this error:
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "E:\\nodejs\\node.exe" "E:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "gulp"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! path E:\nodejs\node_global\gulp
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall open
npm ERR! eisdir EISDIR: illegal operation on a directory, open 'E:\nodejs\node_global\gulp'
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
npm ERR! Please include the following file with any support request:
npm ERR! H:\npm-debug.log
It seems that the error occurs because when it wants to open an director ,in fact it was an file.I checked for the node_global director and found an file named gulp.cmd and a file named gulp too.So there may be conflict between them.
It is an simple problem.I set the config of npm with this
cache=E:\nodejs\node_global
prefix=E:\nodejs\node_global
The cache and prefix should not be placed in same director.May be I just change it by accident.Happy coding:)
I am trying to move node js application from windows machine to linux machine for QA environment and I am having trouble installing couchbase module on linux machine.
It ran fine on windows machine but I've tried this install on 4 different linux machine and I get this error message when I run
npm install couchbase --no-bin-links
I am on precise32 with vagrant for this logs.
couchbase#2.1.3 install /vagrant/MBO 2122016/node_modules/couchbase
prebuild --install
sh: 1: prebuild: not found
npm ERR! Linux 3.2.0-23-generic-pae
npm ERR! argv "/home/vagrant/.nvm/versions/node/v5.3.0/bin/node" "/home/vagrant/.nvm/versions/node/v5.3.0/bin/npm" "install" "couchbase" "--no-bin-links"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! couchbase#2.1.3 install: `prebuild --install`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the couchbase#2.1.3 install script 'prebuild --install'.
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 couchbase package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild --install
npm ERR! You can get their info via:
npm ERR! npm owner ls couchbase
npm ERR! There is likely additional logging output above.
npm ERR! Linux 3.2.0-23-generic-pae
npm ERR! argv "/home/vagrant/.nvm/versions/node/v5.3.0/bin/node" "/home/vagrant/.nvm/versions/node/v5.3.0/bin/npm" "install" "couchbase" "--no-bin-links"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! path npm-debug.log.6258c2ba9fb733156e17534450091eff
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
I have posted npm-debug I got from this command to pastebin
http://pastebin.com/TtPFCSYf
You cannot install it with --no-bin-links on clean environment, because it relies on prebuild binary being accessible. To workaround it, you have to either remove this switch at all, or install prebuild before couchbase without it:
npm install prebuild
npm install couchbase --no-bin-links
I have a vagrant VM with Ubuntu 14 64bit. My host is Windows 8.1. I'm trying to make an npm install on a shared folder (a nodejs app) but even with a
npm install --no-bin-links
it fails with
npm ERR! tar.unpack untar error /root/.npm/node-pre-gyp/0.6.8/package.tgz
npm ERR! tar.unpack untar error /root/.npm/node-pre-gyp/0.6.8/package.tgz
npm ERR! tar.unpack untar error /root/.npm/lodash-node/2.4.1/package.tgz
npm ERR! Linux 3.2.0-23-generic
npm ERR! argv "/usr/local/node/node-v0.12.7/bin/node" "/usr/local/node/node-default/bin/npm" "install" "--no-bin-links"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /vagrant_data/fe/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_
modules/brace-expansion/node_modules/concat-map/package.json.1e22b31c2e50debaced0adc67bb0250c
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! Error: EPERM, open '/vagrant_data/fe/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/
minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json.1e22b31c2e50debaced0adc67bb0250c'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM, open '/vagrant_data/fe/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modu
les/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json.1e22b31c2e50debaced0adc67bb0250c']
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! path: '/vagrant_data/fe/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/n
ode_modules/brace-expansion/node_modules/concat-map/package.json.1e22b31c2e50debaced0adc67bb0250c' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.2.0-23-generic
npm ERR! argv "/usr/local/node/node-v0.12.7/bin/node" "/usr/local/node/node-default/bin/npm" "install" "--no-bin-links"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path npm-debug.log.2e07d69aba2393c854d2992b7057b4c0
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! ETXTBSY, rename 'npm-debug.log.2e07d69aba2393c854d2992b7057b4c0'
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! /vagrant_data/fe/npm-debug.log
and I really can't understand why. My npm version is 2.11.3.
Can you help me?
I'll answer my own question, maybe it will be useful to someone. It's a Vagrant bug, here's the fix:
Github link
EDIT
for those who need some detail: I'm running Vagrant 1.7.2 and VirtualBox 4.3.28.
What I did to solve my problem was to edit the file
# Lines 495-510 - C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.2\plugins\providers\virtualbox\driver\version_4_3.rb
def share_folders(folders)
folders.each do |folder|
args = ["--name",
folder[:name],
"--hostpath",
- folder[:hostpath]]
+ '\\\\?\\' + folder[:hostpath].gsub(/[\/\\]/,'\\')]
args << "--transient" if folder.key?(:transient) && folder[:transient]
# Enable symlinks on the shared folder
execute("setextradata", #uuid, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/#{folder[:name]}", "1")
# Add the shared folder
execute("sharedfolder", "add", #uuid, *args)
end
end
as shown in the Celtric comment (HERE the link).
When I try to install MEANIO on my Mac using npm, I encountered several errors which failed the installation. The errors are shown below:
There are two major types of problem: one is Error EACCES, and the other one is ERROR ENOENT. I have attempted several solutions, which don't really help much.
1. sudo npm clear cache
2. sudo npm update -g
3. Permission fix: by changing nodejs folder's permission to local user
(refer to: npm install errors with Error: ENOENT, chmod)
I wonder what is causing the problem. Since I am not publishing my own app, there is no way to include .npmignore according to the solution provided in the link. The second answer in the link claims that the nature of the problem is:
"Above action caused some dependencies being installed inside ~/.npm/ dir, having root:root ownership (because of sudo ...). Evidently npm does not run as local user (or change dependencies subdirs ownership afterwards) when pulling dependencies and writing them to a local user subdir ~/.npm/. As long as npm would be so careless against fundamental unix filesystem security issues the problem would reoccur."
I doubt if this is the correct in my case. The installation of MEANIO shouldn't be causing so many problems.
The shell commands and error messages are shown below:
localhost:local Nick_Guan$ sudo npm install -g meanio#latest
npm WARN engine meanio#0.6.6: wanted: {"node":"0.10.x","npm":"1.4.x"} (current: {"node":"0.10.31","npm":"2.0.0-beta.1"})
npm WARN engine npm#1.5.0-alpha-4: wanted: {"node":">=0.8","npm":"1"} (current: {"node":"0.10.31","npm":"2.0.0-beta.1"})
> mean-health#0.1.5 postinstall /usr/local/lib/node_modules/meanio/node_modules/mean-health
> node postinstall
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
node.js:815
var cwd = process.cwd();
^
Error: EACCES, permission denied
at Function.startup.resolveArgv0 (node.js:815:23)
at startup (node.js:58:13)
at node.js:906:3
npm ERR! Error: ENOENT, chown '/usr/local/lib/node_modules/meanio/node_modules/prompt/test/prompt-test.js'
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 Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "meanio#latest"
npm ERR! cwd /usr/local
npm ERR! node -v v0.10.31
npm ERR! npm -v 2.0.0-beta.1
npm ERR! path /usr/local/lib/node_modules/meanio/node_modules/prompt/test/prompt-test.js
npm ERR! fstream_path /usr/local/lib/node_modules/meanio/node_modules/prompt/test/prompt-test.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chown
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:308:19
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:143:7
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! Error: ENOENT, chmod '/usr/local/lib/node_modules/meanio/node_modules/npm/bin/npm-cli.js'
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 Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "meanio#latest"
npm ERR! cwd /usr/local
npm ERR! node -v v0.10.31
npm ERR! npm -v 2.0.0-beta.1
npm ERR! path /usr/local/lib/node_modules/meanio/node_modules/npm/bin/npm-cli.js
npm ERR! fstream_path /usr/local/lib/node_modules/meanio/node_modules/npm/bin/npm-cli.js
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 /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:308:19
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! Error: ENOENT, chown '/usr/local/lib/node_modules/meanio/node_modules/bower/lib/config.js'
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 Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "meanio#latest"
Any help would be appreciated.
double check whether prerequisite is installed rightly, make sure execute the install command in somewhere under your home directory.
Check here: https://groups.google.com/forum/#!topic/gnu.bash.bug/JkcxWDfilZI
You're in a directory which can be read and
searched only by root, and you're su'ing to another user. That user
does not have permission to search the current directory, even to find
`..', so getcwd is going to fail.
I had a similar problem and found the permission issue was on the base npm directory in my root user directory /User/tomk/.npm in my case. The subdirectory for npm was owned by root (probably from having to sudo to install node/npm). Once I changed the ownership to my account, meanio installed without the fatal errors (lots of warnings, but nothing to stop the install).
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.