【问题标题】:node.js npm install fs errornode.js npm 安装 fs 错误
【发布时间】:2014-08-27 00:04:27
【问题描述】:
ubuntu@ip-xxx-xx-x-xxx:/var/www/html$ npm install fs
npm WARN package.json crypto@0.0.3 crypto is also the name of a node core module.
npm WARN package.json filesystem@1.0.1 No description
npm WARN package.json http@0.0.0 http is also the name of a node core module.
npm WARN package.json http@0.0.0 No description
npm WARN package.json http@0.0.0 No repository field.
npm WARN package.json js@0.1.0 No repository field.

npm WARN package.json querystring@0.2.0 querystring is also the name of a node core module.
    npm WARN package.json url@0.10.1 url is also the name of a node core module.
    npm WARN package.json util@0.10.3 util is also the name of a node core module.
    npm ERR! 404 Not Found
    npm ERR! 404 
    npm ERR! 404 'fs' is not in the npm registry.
    npm ERR! 404 You should bug the author to publish it
    npm ERR! 404 
    npm ERR! 404 Note that you can also install from a
    npm ERR! 404 tarball, folder, or http url, or git url.

npm 错误!系统 Linux 3.13.0-24-generic npm 错误!命令“/usr/local/bin/node”“/usr/local/bin/npm”“安装”“fs” npm 错误! cwd /var/www/html npm 错误!节点-v v0.10.29 npm 错误! npm -v 1.4.14 npm 错误!代码 E404 npm 错误!错误:EACCES,打开“npm-debug.log” npm 错误! { [错误:EACCES,打开'npm-debug.log'] errno:3,代码:'EACCES',路径:'npm-debug.log'}

npm 错误!请尝试以 root/管理员身份再次运行此命令。

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "fs"
npm ERR! cwd /var/www/html
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/html/npm-debug.log
npm ERR! not ok code 0

我输入了“npm install fs”,但是看到这个错误。

【问题讨论】:

标签: node.js installation npm


【解决方案1】:

你不需要安装 nodejs 内部模块,但你可以更新它们。 fs 是一个内部节点 js 模块!

【讨论】:

    【解决方案2】:

    您收到错误是因为 fs 模块是节点核心模块的一部分。你不需要安装。 http://nodejs.org/api/fs.html

    【讨论】:

    • 我似乎无法导入它们或需要它们。对于import { fs } from "fs";const fs = require('fs'); 中的任何一个,我都会得到Error: Can't resolve 'fs'.
    猜你喜欢
    • 2015-06-16
    • 2015-02-18
    • 2011-11-12
    • 2016-03-11
    • 1970-01-01
    • 1970-01-01
    • 2012-06-02
    • 2011-11-22
    • 2023-03-30
    相关资源
    最近更新 更多