This repository has been archived by the owner. It is now read-only.

unknown symlink '../express/bin/express #2380

Closed
janheski opened this Issue Apr 17, 2012 · 28 comments

Comments

Projects
None yet
@janheski
Copy link

janheski commented Apr 17, 2012

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

@oveddan

This comment has been minimized.

Copy link

oveddan commented May 1, 2012

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
verbose from cache /mnt/hgfs/Source/testNpm/node_modules/express/package.json
info preuninstall express@2.5.9
info uninstall express@2.5.9
verbose unbuild express@2.5.9 [ true,
verbose unbuild express@2.5.9 '/mnt/hgfs/Source/testNpm/node_modules',
verbose unbuild express@2.5.9 '/mnt/hgfs/Source/testNpm/node_modules' ]
verbose binRoot [ '/mnt/hgfs/Source/testNpm/node_modules/.bin',
verbose binRoot { express: './bin/express' } ]
info postuninstall express@2.5.9
ERR! Error: UNKNOWN, symlink '../express/bin/express'
ERR! You may report this log at:
ERR! http://github.com/isaacs/npm/issues
ERR! or email it to:
ERR! npm-@googlegroups.com
ERR!
ERR! System Linux 3.0.0-12-generic
ERR! command "node" "/usr/bin/npm" "install" "express"
ERR! cwd /mnt/hgfs/Source/testNpm
ERR! node -v v0.6.16
ERR! npm -v 1.1.19
ERR! path ../express/bin/express
ERR! code UNKNOWN
ERR! message UNKNOWN, symlink '../express/bin/express'
ERR! errno {}
verbose exit [ 1, true ]

@janheski

This comment has been minimized.

Copy link

janheski commented May 1, 2012

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.

@oveddan

This comment has been minimized.

Copy link

oveddan commented May 1, 2012

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:
http://www.vmware.com/support/ws4/doc/running_sharefold_ws.html

"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."

@oveddan

This comment has been minimized.

Copy link

oveddan commented May 2, 2012

Certain packages can install successfully, such as chai and mustache. However, the following packages also fail:
"jade" fails with:

npm http 304 https://registry.npmjs.org/commander/0.5.2
npm http 304 https://registry.npmjs.org/mkdirp/0.3.0
npm ERR! error installing jade@0.25.0

npm ERR! Error: UNKNOWN, unknown error '../jade/bin/jade'
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.2.0-24-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "jade"
npm ERR! cwd /mnt/hgfs/Source/testNpm
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.0-3
npm ERR! path ../jade/bin/jade
npm ERR! code UNKNOWN
npm ERR! message UNKNOWN, unknown error '../jade/bin/jade'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /mnt/hgfs/Source/testNpm/npm-debug.log
npm not ok

"mocha" fails with:

npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/mkdirp
npm ERR! error installing jade@0.20.3
npm ERR! error installing mocha@1.0.3

npm ERR! Error: UNKNOWN, unknown error '../jade/bin/jade'
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.2.0-24-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "mocha"
npm ERR! cwd /mnt/hgfs/Source/testNpm
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.0-3
npm ERR! path ../jade/bin/jade
npm ERR! code UNKNOWN
npm ERR! message UNKNOWN, unknown error '../jade/bin/jade'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /mnt/hgfs/Source/testNpm/npm-debug.log
npm not ok

@oveddan

This comment has been minimized.

Copy link

oveddan commented May 2, 2012

Also, running "make" on the npm source gives a similar error:

pm http GET https://registry.npmjs.org/opts
npm http 304 https://registry.npmjs.org/opts

npm ERR! Error: UNKNOWN, unknown error '../ronn/bin/ronn.js'
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.2.0-24-generic
npm ERR! command "node" "/mnt/hgfs/Source/openSource/npm/cli.js" "install" "https://github.com/isaacs/ronnjs/tarball/master"
npm ERR! cwd /mnt/hgfs/Source/openSource/npm
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.19
npm ERR! path ../ronn/bin/ronn.js
npm ERR! code UNKNOWN
npm ERR! message UNKNOWN, unknown error '../ronn/bin/ronn.js'
npm ERR! errno {}
npm ERR!

@topliceanu

This comment has been minimized.

Copy link

topliceanu commented May 10, 2012

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 sudo npm install -g <package>, then setting $NODE_PATH (which was empty before?!) to the location of the global npm repository, in my case /usr/local/lib/node_modules.

Something like:

sudo npm install -g express
export NODE_PATH=/usr/local/lib/node_modules

Is there a better to run node apps from shared folders? Am i doing something stupid here?

@nerdess

This comment has been minimized.

Copy link

nerdess commented Jul 1, 2012

@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

@MaciekBaron

This comment has been minimized.

Copy link

MaciekBaron commented Aug 5, 2012

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...

@MaciekBaron

This comment has been minimized.

Copy link

MaciekBaron commented Aug 5, 2012

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.

@pixelcort

This comment has been minimized.

Copy link

pixelcort commented Aug 10, 2012

Looks like it's an issue with VirtualBox: https://www.virtualbox.org/ticket/10085 .

@indirectlylit

This comment has been minimized.

Copy link

indirectlylit commented Oct 13, 2012

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

@rishabhmhjn

This comment has been minimized.

Copy link

rishabhmhjn commented Nov 20, 2012

The reason it was not working on shared folders was that it cannot create a sym-link on the shared folder.
If its in an all unix based systems, it will work!

@MaciekBaron

This comment has been minimized.

Copy link

MaciekBaron commented Nov 28, 2012

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.

@isaacs

This comment has been minimized.

Copy link
Member

isaacs commented Dec 1, 2012

@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.

@isaacs isaacs closed this Dec 1, 2012

@dougmartin

This comment has been minimized.

Copy link

dougmartin commented Dec 31, 2012

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.

@rhoot

This comment has been minimized.

Copy link
Contributor

rhoot commented Jan 23, 2013

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.

@isaacs

This comment has been minimized.

Copy link
Member

isaacs commented Jan 23, 2013

adding an opt-in option to "npm install" that disables symlinking

Patch welcome.

@rhoot

This comment has been minimized.

Copy link
Contributor

rhoot commented Jan 24, 2013

It seems github doesn't pick up on issue numbers in pull request titles, but there's a pull request at #3090.

@jcollum

This comment has been minimized.

Copy link

jcollum commented Mar 12, 2013

@rhoot thanks, this seems to have fixed the issue that i was having

@asafh

This comment has been minimized.

Copy link

asafh commented Apr 23, 2013

Thanks @rhoot, that solves the issue

@sdether

This comment has been minimized.

Copy link

sdether commented Jun 2, 2013

@rhoot Just wanted to add my thanks as well. Was pulling my hair out why my dev env was just not behaving

@fresheneesz

This comment has been minimized.

Copy link

fresheneesz commented Sep 30, 2013

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 require in a node.js script)?

@luk-

This comment has been minimized.

Copy link
Contributor

luk- commented Oct 1, 2013

No, not unless someone is doing something very wrong under the hood in
their module.

On Monday, September 30, 2013, fresheneesz wrote:

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 require in a node.js script)?


Reply to this email directly or view it on GitHubhttps://github.com/isaacs/npm/issues/2380#issuecomment-25415853
.

@laurentperroteau

This comment has been minimized.

Copy link

laurentperroteau commented Nov 28, 2013

Thanks @rhoot, it works for me :
npm install grunt-contrib-compass --save-dev --no-bin-links

@pgdesigning

This comment has been minimized.

Copy link

pgdesigning commented Oct 1, 2015

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
bin-links=false

@mvucinic

This comment has been minimized.

Copy link

mvucinic commented Oct 1, 2015

Great, that worked, thanks a lot!

@kag0

This comment has been minimized.

Copy link

kag0 commented Oct 20, 2015

works perfect 👌

@gdlm91

This comment has been minimized.

Copy link

gdlm91 commented Jan 26, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.