Tag: npm

错误:使用Next.js在Heroku上产生EACCES

当我尝试将我的Next.js项目推送到Heroku时,出现以下错误。 它在本地正常工作。 另外我以前的提交在Heroku上工作。 我现在试图将新版本的项目推到Heroku,package.json没有改变,我得到以下错误: remote: Compressing source files… done. remote: Building source: remote: remote: —–> Node.js app detected remote: remote: —–> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NPM_CONFIG_PRODUCTION=true remote: NODE_VERBOSE=false remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote: remote: —–> Installing binaries remote: engines.node (package.json): unspecified remote: engines.npm (package.json): unspecified (use default) remote: remote: Resolving node version […]

NPM安装在networking共享文件夹UNCpath错误

我正在Intranet服务器的networking共享文件夹中创build一个项目。 我是一个初学者,我不知道该怎么做。 这就是我在package.json中获取的内容 { "name": "Test Project", "version": "0.0.1", "description": "My Test Project", "dependencies": { "animate.css": "3.5.2", "font-awesome": "4.7.0", "vue": "^2.2.2", "vue-axios": "^2.0.1", "admin-lte": "^2.3.11" }, "devDependencies": { "babel-core": "^6.1.2", "babel-loader": "^6.1.0", "babel-plugin-transform-runtime": "^6.1.2", "babel-preset-es2015": "^6.1.2", "babel-preset-stage-0": "^6.1.2", "babel-runtime": "^5.8.0", "webpack": "^1.12.2" }, "author": "Me" } 但是,安装中断和UNCpath错误发生。 我认为这与CMD无法读取networkingpath有关。 完整的执行结果: 任何解决方法?

Node.JS – 在使用npm install时,与Node-gyp和/或ELIFECYCLE错误

我试图安装npm库“夏普”,但是当我尝试运行npm安装命令,我得到这在我的控制台: > sharp@0.18.2 install C:\Users\apixe\Documents\GS Bot\Bots\Child\node_modules\sharp > node-gyp rebuild C:\Users\apixe\Documents\GS Bot\Bots\Child\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\apixe\AppData\Roaming\npm\node_modules\npm\bin\node-gyp- bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild ) gyp ERR! UNCAUGHT EXCEPTION gyp ERR! stack Error: Cannot find module 'minimatch' gyp ERR! stack at Function.Module._resolveFilename (module.js:485:15) gyp ERR! stack at Function.Module._load (module.js:437:25) gyp ERR! stack at Module.require (module.js:513:17) gyp […]

我应该提供什么“消化”论据?

我以前在login和注册function中有以下代码: var crypto = require('crypto'); … … this.hash = crypto.pbkdf2Sync(password, this.salt, 1000, 64).toString('hex'); 而且我已经注册用户。 昨天我更新了npm,现在显示错误: events.js:182 throw er; // Unhandled 'error' event ^ TypeError: The "digest" argument is required and must not be undefined at pbkdf2 (crypto.js:635:11) at Object.exports.pbkdf2Sync (crypto.js:628:10) at model.UserSchema.methods.validPassword (/opt/myapp/models/Users.js:35:23) at /opt/myapp/config/passport.js:16:23 at model.Query.<anonymous> (/opt/myapp/node_modules/mongoose/lib/model.js:3745:16) at /opt/myapp/node_modules/kareem/index.js:277:21 at /opt/myapp/node_modules/kareem/index.js:131:16 at _combinedTickCallback (internal/process/next_tick.js:131:7) […]

将节点模块安装到由多个子组件共享的node_modules文件夹中

我有一个大的node.js项目,结构如下: Root |_node_modules . . |_Component_1 |_src |_file1.js . . |_package.json |_Component_2 |_src |_file1.js . . |_package.json . . |_Component_n |_src |_file1.js . . |_package.json 为了避免冗余,所有组件都应该安装它们的节点模块,并且直接在根目录下的共享node_modules文件夹中要求它们。 如何configuration组件的package.json以安装到root / node_modules?

在centos7中设置bitcore

我想在我的系统(centos7)中设置bitcore, 这里是我现在的系统细节,它满足了bitcore的基本要求: centos7 : 7.3.1611 npm : 2.25.11 nvm : 0.25.0 node : 4.8.4 Ram : 8GB hard-disk space : 500 GB 所有的基本设置我都成功了。 现在我正在尝试使用bellow命令在我的系统中安装bitcore npm install -g bitcore 但我面对错误像波纹pipe: Unpacking bitcoin distribution bitcoin-0.12.1/ bitcoin-0.12.1/bin/ bitcoin-0.12.1/bin/bitcoin-cli bitcoin-0.12.1/bin/bitcoind bitcoin-0.12.1/bin/bitcoin-qt bitcoin-0.12.1/bin/bitcoin-tx bitcoin-0.12.1/bin/test_bitcoin bitcoin-0.12.1/bin/wallet-utility bitcoin-0.12.1/include/ bitcoin-0.12.1/include/bitcoinconsensus.h bitcoin-0.12.1/lib/ bitcoin-0.12.1/lib/libbitcoinconsensus.so bitcoin-0.12.1/lib/libbitcoinconsensus.so.0 bitcoin-0.12.1/lib/libbitcoinconsensus.so.0.0.0 > zmq@2.15.3 install /root/.nvm/versions/node/v4.8.4/lib/node_modules/bitcore/node_modules/bitcore-node/node_modules/zmq > node-gyp rebuild gyp WARN […]

在NPM作用域包中公开两个(或更多)Node.js Babel类

我有一个公共范围的包中的两个Node.js Babel类,并希望将它们公开。 公共范围的NPM中的类: Index.js export default class Index { constructor() { console.log("abc!"); } } SecondClass.js export default class SecondClass { constructor() { console.log("SecondClass! SecondClass!! SecondClass!!!"); } } 在公共范围的NPM中,我只能设置一个主文件: "main": "./dist/index.js", 而在使用项目,我试图导入他们,但我失败了! import { Index, SecondClass } from '@my-scope/my-package'; new Index(); new SecondClass(); 依赖关系: "devDependencies": { "babel-cli": "^6.26.0", "babel-preset-es2015": "^6.24.1" } 我该怎么做? 我能以某种方式做到吗? 更新1:即使使用包中的files没有工作,使情况变得更糟,一旦我使用它,所有的JS文件都没有了,当我在用法项目中安装我的范围包。 "files": [ […]

安装angular-cli

对我来说angular度是相当新的,英语不是我的第一语言,所以我提前道歉。 我是一名学生,我必须使用MEAN平台做一个应用程序。 我们从来没有使用任何平均值组件,或大学的JavaScript,但现在我必须做这个项目。 我正在按照这个教程 – > https://www.youtube.com/watch?v=wtIvu085uU0&list=PLTPtZWpWLI00vlAPQnDt8OlPwoYxuMCQo&index=4 ,一切长达45分钟的video工作得很好。 在45分钟,它说我必须安装@angular/cli但我第一次@angular/cli 。 然后我试着再inputnpm install @angular/cli ,然后就没有错误了。 就像它应该是,就像在video中一样。 但是,当我inputng new client它说 ng is not recognized as an internal or external command, operable program or batch file. 我不知道该怎么做,我试着再次安装angular-cli,但每次都是一样的。 我很绝望。 版本: 节点–version = v6.11.3 npm –version = 3.10.10 Windows 10 当我input“npm install @ angular / cli”时出现错误: npm ERR! tarball.destroy is […]

Nodejs – npm安装永久冻结

我有npm奇怪的问题:安装过程永久冻结在加载阶段。 在安装nodejs之后,我尝试安装angular-cli,但是它停留在加载阶段: c:\>npm install -g @angular/cli npm info it worked if it ends with ok npm info using npm@3.10.10 npm info using node@v6.11.3 npm info ok npm info it worked if it ends with ok npm info using npm@3.10.10 npm info using node@v6.11.3 npm info attempt registry request try #1 at 1:35:34 PM npm http […]

如何将npm包添加到docker图像而不用重新制作图像或容器?

问题:如何安装新软件包并获取docker映像和容器以识别更改,安装和重新运行而不与开发人员进行交互? package.json : 注意我们只有一个包 "scripts": { "start": "node_modules/.bin/nodemon" }, "dependencies": { "express": "4.15.4" } dockerfile FROM node:8.4.0 ENV HOME /var/www WORKDIR ${HOME} COPY server/package.json server/tsconfig.json server/nodemon.json $HOME/ RUN npm install EXPOSE 8191 CMD [ "npm", "start" ] 制作图片 : docker build . -t testImage 运行容器 : docker run -p 8191:8191 -v $(pwd)/server/src:/var/www/src testImage 一切工作正常[nodemon] starting节点[nodemon] […]