Problem when I execute npm install on docker

后端 未结 3 762
南方客
南方客 2020-12-18 08:10

Working on the same project as a colleague, when performing npm install I have the following problem, although none of my colleagues have the same problem. We all use docker

3条回答
  •  忘掉有多难
    2020-12-18 08:21

    I have a Windows 10 with docker and I use the following workaround. Into the docker, in my home I create a directory, for example:

    /home/my_project/node_modules.

    Them in my mapped directory within windows and linux(into the docker) I make a symbolic link within the directory I created before an "node_modules". Something like

    ln -s src dest

    ln -s /home/my_project/node_modules /var/www/html/my_project/node_modules

    Them, into my project I call the

    npm install

    With this solution, the node-sass install with no problem.

    I'm not an expert but I think the problem was the mapping within the windows and linux and the way that npm installs with links this package.

    Best regards

提交回复
热议问题