Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install node package #9

Closed
nojaf opened this issue Oct 13, 2016 · 4 comments
Closed

Cannot install node package #9

nojaf opened this issue Oct 13, 2016 · 4 comments

Comments

@nojaf
Copy link

nojaf commented Oct 13, 2016

Hi Stefan.

First of all every cool that you've created a nodejs image using windows!

I've created a container using:

docker run -it --rm --name my-yarn-app -v "${pwd}:C:\App" -w "C:\App" -p 3000:3000 -p 9000:9000 stefanscherer/node-windows powershell

I tried to install node-sass but ran into a problem

npm install node-sass --save-dev

and I got

PS C:\App> npm install node-sass --save-dev
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info ok
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass" "--save-dev"
npm ERR! node v6.8.0
npm ERR! npm  v3.10.8
npm ERR! path C:\ContainerMappedDirectories
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall lstat

npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\ContainerMappedDirectories'
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\ContainerMappedDirectories'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\App\npm-debug.log

Any ideas?

@StefanScherer
Copy link
Owner

@nojaf Hi Florian!

Thanks for trying! Yes, this is a known problem running node or npm in a volume mount point. I've opened nodejs/node#8897 to discuss the problem with the Node.js maintainers.

At the moment you have to COPY the sources into the container or use the onbuild docker image.

I'll close this issue as it is handled in the nodejs/node upstream repo.

@StefanScherer
Copy link
Owner

StefanScherer commented Oct 16, 2016

@nojaf I just forgot about the other solution: Use Node.js 4.6.0, the problem only occurs in Node.js 6.x

docker run -it --rm --name my-yarn-app -v "${pwd}:C:\App" -w "C:\App" -p 3000:3000 -p 9000:9000 stefanscherer/node-windows:4.6.0 powershell

@nojaf
Copy link
Author

nojaf commented Oct 16, 2016

Thanks @StefanScherer, works indeed!

@Fredoid
Copy link

Fredoid commented May 21, 2018

Arf, I have the same issue with stefanscherer/node-windows:4.6.0 image.
Following error appears when I execute this PS script.

PS Script

$BaseDir = Split-Path $MyInvocation.MyCommand.Path
cd $BaseDir
r.js.cmd -o build.js

Raised Error

webapp.cdn.build_1  | Error: Error: ENOENT: no such file or directory, lstat 'C:\ContainerMappedDirectories'
webapp.cdn.build_1  |     at Error (native)

Same issue with :

  • stefanscherer/node-windows:latest
  • isolation: hyperv in compose file

Thanks,
Fred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants