相关疑难解决方法(0)

没有sudo,NPM模块不会全局安装

我刚刚重新安装了Ubuntu 12.04 LTS,之前我做了以下其他步骤:

  1. 通过包管理器使用以下脚本安装节点

    sudo apt-get update
    
    sudo apt-get install python-software-properties python g++ make
    
    sudo add-apt-repository ppa:chris-lea/node.js
    
    sudo apt-get update
    
    sudo apt-get install nodejs
    
    Run Code Online (Sandbox Code Playgroud)
  2. 试图在全球安装yeoman,express,n,yeoman的发电机,所有这些都返回了相同的错误

    错误的ERR!错误:EACCES,符号链接'../lib/node_modules/n/bin/n'

    错误的ERR!{[错误:EACCES,符号链接'../lib/node_modules/n/bin/n']错误号:3,代码:'EACCES',路径:'../lib/node_modules/n/bin/n'}

    错误的ERR!

    错误的ERR!请尝试以root/Administrator身份再次运行此命令.

    错误的ERR!系统Linux 3.8.0-29-通用

    错误的ERR!命令"/ usr/bin/node""/ usr/bin/npm""install"" - g"" - d""n"

    错误的ERR!cwd/home/heberlz

    错误的ERR!node -v v0.10.20

    错误的ERR!npm -v 1.3.11

    错误的ERR!路径../lib/node_modules/n/bin/n

    错误的ERR!代码EACCES

    错误的ERR!错误3

    错误的ERR!堆栈错误:EACCES,符号链接'../lib/node_modules/n/bin/n'

    错误的ERR!

    错误的ERR!其他记录详细信息可在以下位置找到

    错误的ERR!/home/heberlz/npm-debug.log

    错误的ERR!不好的代码0

  3. 以递归方式回收以下文件夹的所有权〜/ .npm,/ usr/lib/node,/ usr/lib/node_modules以及以下符号链接/ usr/bin/node,/ usr/bin/nodejs 绝对没有成功

我需要安装yeoman及其发电机,没有sudo以后不会遇到麻烦:(

ubuntu node.js npm node-modules yeoman

122
推荐指数
5
解决办法
9万
查看次数

安装npm模块时权限被拒绝

我尝试安装npm模块时收到一个奇怪的权限错误.我正在启动它sudo所以我确定我有访问权限,但由于某种原因它一直抱怨错误:

堆栈错误:EACCES:权限被拒绝,mkdir'/ usr/lib/node_modules/joplin/node_modules/sqlite3/build'

我已经尝试重新启动计算机,并/usr/lib/node_modules/joplin使用chmod 777 创建目录,但它仍然无效.

$ sudo npm install -g joplin
/usr/bin/joplin -> /usr/lib/node_modules/joplin/main.js

> sqlite3@3.1.9 install /usr/lib/node_modules/joplin/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.9/node-v48-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.9 and node@6.11.2 (node-v48 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/joplin/node_modules/sqlite3/build'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 4.4.0-43-Microsoft
gyp ERR! command "/usr/bin/nodejs" …
Run Code Online (Sandbox Code Playgroud)

file-permissions module node.js npm

18
推荐指数
2
解决办法
2万
查看次数

标签 统计

node.js ×2

npm ×2

file-permissions ×1

module ×1

node-modules ×1

ubuntu ×1

yeoman ×1