-
Notifications
You must be signed in to change notification settings - Fork 3k
unknown symlink '../express/bin/express #2380
Comments
I get this error too. This happens when I am using a virtual WMwarePlayer Ubuntu OS, and install express in a "Shared Folder" pointing to a location on my hard drive external to Ubuntu. When using a location on a folder within the standard Ubuntu location, I do not get this error. Using npm version 1.1.19 The end of npm-debug.log looks like: info unbuild /mnt/hgfs/Source/testNpm/node_modules/express |
Yes, thanks. It is same in my case. I use VirtualBox for debian, and host is windows 7. Error happens when running code from debian which lays on windows 7 disc. When code is on debian disk, there is no error. |
I think this has something to do with symbolic links not working on Windows drives. This is stated on VMWare Player's support article, but it's probably the same for VirtualBox: "Note: You can use shared folders to share any type of file. However, Windows shortcuts and Linux symbolic links do not work correctly if you try to use them via shared folders." |
Certain packages can install successfully, such as chai and mustache. However, the following packages also fail: npm http 304 https://registry.npmjs.org/commander/0.5.2 npm ERR! Error: UNKNOWN, unknown error '../jade/bin/jade' "mocha" fails with: npm http GET https://registry.npmjs.org/mkdirp npm ERR! Error: UNKNOWN, unknown error '../jade/bin/jade' |
Also, running "make" on the npm source gives a similar error: pm http GET https://registry.npmjs.org/opts npm ERR! Error: UNKNOWN, unknown error '../ronn/bin/ronn.js' |
I had the same error with node v0.6.17 and npm v1.1.21 on ubuntu 12.04 installed with VMWare Player v4.0.3 on a host Windows 7. I made it work by installing all dependencies globally one by one with Something like:
Is there a better to run node apps from shared folders? Am i doing something stupid here? |
@topliceanu thx, with your hints i was able to get the modules set up on a debian vm with windows 7 as host machine. still a massive hassle and feels kinda dirty having it all installed globally, seriouly thinking of switching to mac now :D |
Has anyone found a good solution for this? It's a shame that the whole concept of running virtualised servers that work the same on every machine is ruined by this... |
Ok, just to let you know guys, everything seems to work okay if I run vagrant and consequently the VM as an administrator (i.e. I run cmd as an Admin). There seems to be some weird privilage bug. |
Looks like it's an issue with VirtualBox: https://www.virtualbox.org/ticket/10085 . |
For what it's worth: this script installs all your application's required packages (defined using package.json and npm-shrinkwrap.json) to a non-shared directory, and then adds the directory to the Node path. # installNodeModules.sh - Takes your source and target directories as arguments.
test -d $2 || mkdir $2
cd $2
# Set the NODE_PATH global variable
test "$NODE_PATH" || echo NODE_PATH=$2/node_modules >> /etc/environment
# Copy over package.json and npm-shrinkwrap.json
cp $1/package.json ./package.json
cp $1/npm-shrinkwrap.json ./npm-shrinkwrap.json
# Install required modules
npm install Then you can call it from your Vagrantfile like this: Vagrant::Config.run do |config|
config.vm.provision :shell do |shell|
shell.path = "installNodeModules.sh"
shell.args = "/vagrant /usr/local/lib/node_app_modules"
end
end It's still a "global" installation here, but you could probably tweak it to be application-specific if necessary. Tested with an Ubuntu 12.04 guest, npm 1.1.48, node 0.8.6 |
The reason it was not working on shared folders was that it cannot create a sym-link on the shared folder. |
Rishabhmhjn, that's not entirely true as it works on a Windows PC if you run it properly as an Administrator. It does seem a bit fishy though. |
@MaciekBaron If you are on a windows pc, and working in a vm that is unix, then npm has no way of knowing that it's not "real" unix. The file system in that case doesn't support windows symlinks, though it does support Junctions, which is what fs.symlink does on Windows systems. There is probably no way to make npm work flawlessly on Windows file systems that are mounted in Unix VMs. |
It isn't an ideal solution but you can do the npm install with an express package dependency on VirtualBox on Windows if you install node.js for Windows and do it from the Window's side of the shared folder. The reason it isn't ideal of course is that you can't automatically run it as part of your Vagrant startup provisioning scripts. |
What about - as a sort of workaround - adding an opt-in option to "npm install" that disables symlinking? I could definitely live without binaries being symlinked. |
Patch welcome. |
It seems github doesn't pick up on issue numbers in pull request titles, but there's a pull request at #3090. |
@rhoot thanks, this seems to have fixed the issue that i was having |
Thanks @rhoot, that solves the issue |
@rhoot Just wanted to add my thanks as well. Was pulling my hair out why my dev env was just not behaving |
Just came across this issue. Does disabling bin links have the possibility of ruining the functionality of any node modules, when used solely as a node module (via a |
No, not unless someone is doing something very wrong under the hood in On Monday, September 30, 2013, fresheneesz wrote:
|
Thanks @rhoot, it works for me : |
I had the same issue in my docker, here is the solution instead always using --no-bin-links. $npm config edit #add this line to the config file |
Great, that worked, thanks a lot! |
works perfect 👌 |
This totally worked for me. I'm using Vagrant with Windows as Host and Ubuntu Trusty as Guest, installing my service in /Vagrant/somesharedfolder and doing '--no-bin-links' did the trick. |
Hi, I encounter such error and cannot install express. It was working before and suddenly it stopped (after I've tried to deploy it on nodester but not successfully because of native lib I use). So I can't run my nodejs app locally now either on ubuntu or debian.
npm ERR! Error: UNKNOWN, symlink '../express/bin/express'
npm ERR! 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!
npm ERR! System Linux 3.0.0-17-generic
npm ERR! command "node" "(...)/.nvm/v0.6.15/bin/npm" "install" "-d"
npm ERR! cwd (...)
npm ERR! node -v v0.6.15
npm ERR! npm -v 1.1.16
npm ERR! path ../express/bin/express
npm ERR! code UNKNOWN
npm ERR! message UNKNOWN, symlink '../express/bin/express'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! (...)/npm-debug.log
npm not ok
The text was updated successfully, but these errors were encountered: