Tag: npm install

NodeJS包pipe理

我想运行这个简单的代码行(使用Node.js 8.0.0): time node -e "console.log(require('bcrypt').hashSync(process.argv[1], 8));" your-password-here 比较bcrypt和运行Linux Alpine的RaspberryPi上的bcryptjs。 起初它给了我: module.js:487 throw err; ^ Error: Cannot find module 'bcrypt' at Function.Module._resolveFilename (module.js:485:15) at (…) at evalScript (bootstrap_node.js:432:27) 所以我试着用这个命令安装bcrypt: npm install -g –production bcrypt 哪些工作(后回落编译从源代码,因为没有发现我的armv7处理器的Linux依赖)。 但是当再次尝试testing命令时,我有完全相同的错误(找不到模块'bcrypt')。 这只是做了我认为是“项目本地”安装没有“-g”选项(即使我没有项目),它终于工作和bcrypt运行我的testing命令时发现。 npm install bcrypt 有些熟悉NodeJS的人可以解释一下这个奇怪的机制吗?

npm安装后npm缺less的包

我决定在远程机器上部署我的软件,但是当我开始“npm install”添加package.json的每个包时,不可能添加“supertest”包。 我尝试了很多方法来解决问题,删除node_modules并重新启动npm install两次,或者使用Yarn代替NPM。 $ npm install supertest + supertest@2.0.1 removed 13 packages and updated 3 packages in 2.28s api-http@remotemachine:~/api-http$ npm test > api-http@0.0.1 test /home/api-http/api-http > NODE_ENV=test mocha –recursive test module.js:487 throw err; ^ Error: Cannot find module 'supertest' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/home/api-http/api-http/test/app/controllers/crop.js:3:17) […]

无效协议:在Windows 10上通过NPM进行安装时发生空错误

我越来越 无效的协议:null 错误,当我试图安装在Windows 10中使用NPM的任何软件包。

用于服务器和客户端的Package.json

我想从我的服务器端package.json的客户端安装package.json作为服务器端使用节点和客户端是使用angular2目录结构 server-app –bin –node_modules –package.json –client-app –app –node_modules –package.json 现在的问题是: 我必须运行这个命令npm安装从服务器应用程序文件夹 ,也从服务器应用程序/客户端应用程序文件夹分开这将创build部署问题 我想要的只是从服务器应用程序运行一次npm安装 ,它也会自动安装server-app package.json和client-side-app package.json。 任何帮助将不胜感激

NPM安装错误本地回购权限被拒绝(publickey)

获取权限拒绝在我的公司github本地回购错误,我可以克隆成功,但获取NPM安装错误: npm ERR! Error while executing: npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t git@<repo path and name> npm ERR! npm ERR! Permission denied (publickey). npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists. npm ERR! npm […]

Firebase Firebase部署错误的云端函数:错误parsing触发器:无法find模块'firebase-admin'“

当我运行firebase deploy我得到这个错误: Error parsing triggers: Cannot find module 'firebase-admin' 这是我的代码: const functions = require('firebase-functions'); const admin = require('firebase-admin'); 我的package.json是: { "name": "functions", "description": "Cloud Functions for Firebase", "dependencies": { "firebase-admin": "^5.2.1", "firebase-functions": "^0.6.2", "request": "^2.83.0" }, "private": true } 这里是我的全局节点模块: npm list -g –depth=0 /Users/TDK/.nvm/versions/node/v6.11.2/lib ├── child_process@1.0.2 ├── firebase-admin@5.3.0 ├── firebase-tools@3.12.0 ├── fs@0.0.2 ├── npm@5.4.2 […]

为什么我不能将npm install安装到sed,同时保留颜色和进度更新?

如果我inputnpm i | sed "s/^/ /" npm i | sed "s/^/ /" ,打印到标准输出时, npm i的输出没有间隔。 例如,我得到以下内容: $ npm i | sed "s/^/ /" npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN [name_removed]@0.0.2 No repository field. npm WARN [name_removed]@0.0.2 No […]

为什么node-npm在安装@ angular / cli时失败,校验和失败?

我正在使用节点v6.11.5和npm 3.10.10和64位操作系统,并安装@ angular / cli时我收到以下错误: C:\WINDOWS\system32>npm install -g @angular/cli npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli" npm ERR! node v6.11.5 npm ERR! npm v3.10.10 npm ERR! shasum check failed for C:\Users\Shubham\AppData\Local\Temp\npm-6192-9e acb63c\registry.npmjs.org\rxjs\-\rxjs-5.5.2.tgz npm ERR! Expected: 28d403f0071121967f18ad665563255d54236ac3 npm ERR! Actual: c2b697120c7dc0e6728da0e7636b90e15723cc24 npm ERR! From: http://registry.npmjs.org/rxjs/-/rxjs-5.5.2.tgz npm ERR! npm […]

Vue项目和googleapis – 不会生成 – child_process错误

目标 在vue-cli项目中安装并构buildgoogleapis包。 例 https://github.com/ChaddPortwine/test-googleapis 为了创build这个例子,我简单地: vue init webpack test-googleapis npm install npm install googleapis –save , npm install google-auth-library –save npm run dev (到目前为止,没关系,应用程序build立和运行) 添加行, import googleapis from 'googleapis'到main.js npm run dev (ERR Child_Process ) 错误 ERROR Failed to compile with 13 errors 11:16:12 AM These dependencies were not found: * child_process in ./node_modules/googleapis/node_modules/google-auth-library/lib/auth/googleauth.js * […]

如何使用npm将PDF.JS导入到Typescript中

我安装了PDF.JS npm软件包,并将其导入打字稿文件中,但不能按预期工作。 我使用下面的代码将PDF.JS导入打字稿。 import { PDFJSStatic } from 'pdfjs-dist'; const PDFJS: PDFJSStatic = require('pdfjs-dist'); PDFJS.getDocument('helloworld.pdf').then(console.log); 我得到的错误 严重级代码说明项目文件行抑制状态错误TS2307找不到模块“pdfjs-dist”。 app.ts 2活动的严重程度代码说明项目文件行抑制状态错误TS2304找不到名称'require'。 app.ts 3 Active 请提供您宝贵的build议,让我知道我错过了什么,如果有的话。