Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

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

Closed
@janheski

Description

@janheski

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

Activity

oveddan

oveddan commented on May 1, 2012

@oveddan

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

janheski commented on May 1, 2012

@janheski
Author

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

oveddan commented on May 1, 2012

@oveddan

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

oveddan commented on May 2, 2012

@oveddan

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

oveddan commented on May 2, 2012

@oveddan

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

topliceanu commented on May 10, 2012

@topliceanu

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

nerdess commented on Jul 1, 2012

@nerdess

@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

MaciekBaron commented on Aug 5, 2012

@MaciekBaron

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

MaciekBaron commented on Aug 5, 2012

@MaciekBaron

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

pixelcort commented on Aug 10, 2012

@pixelcort

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

indirectlylit

indirectlylit commented on Oct 13, 2012

@indirectlylit

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

rishabhmhjn commented on Nov 20, 2012

@rishabhmhjn

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

MaciekBaron commented on Nov 28, 2012

@MaciekBaron

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

isaacs commented on Dec 1, 2012

@isaacs
Contributor

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

27 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @isaacs@pixelcort@luk-@dougmartin@sdether

        Issue actions

          unknown symlink '../express/bin/express · Issue #2380 · npm/npm