安装nodejs npm和grunt会给出错误 [英] installing nodejs npm and grunt gives errors

查看:267
本文介绍了安装nodejs npm和grunt会给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Python,NodeJS,NPM或Grunt不熟悉,但我需要安装它,因为我想尝试 Github项目

我从node.org下载了NodeJS,并按照本网站。它似乎工作,因为进入节点并运行 console.log 工作。



我试着安装NPM line

  sudo npm install npm -g 

..正如 NPM网站。这似乎工作。



遵循 Grunt网站让我更新NPM

  npm update -g npm 

并安装CLI

  npm install -g grunt-cli 

这将导致以下消息:

  / usr / local / bin / grunt  - > / usr / local / lib / node_modules / grunt-cli / bin / grunt 
grunt-cli@0.1.13 / usr / local / lib / node_modules / grunt-cli
├──resolve@0.3。 1
├──nopt@1.0.10(abbrev@1.0.5)
└──findup-sync@0.1.3(lodash@2.4.1,glob@3.2.11)

github页面run npm install 原来是有问题的。这导致了这些错误:

  MacBook-Pro-van-Paul:〜Paul $ sudo npm install 
npm ERR !安装无法读取依赖项
npm ERR!达尔文14.0.0
npm ERR! argvnode/ usr / local / bin / npminstall
npm ERR!节点v0.10.33
npm ERR! npm v2.1.10
npm ERR!路径/Users/Paul/package.json
npm ERR!代码ENOPACKAGEJSON
npm ERR! errno 34

npm ERR! package.json ENOENT,打开'/Users/Paul/package.json'
npm ERR! package.json这很可能不是npm本身的问题。
npm ERR! package.json npm在当前目录中找不到package.json文件。

npm ERR!请包含以下任何支持请求的文件:
npm ERR! /Users/Paul/npm-debug.log

就像我说的,我没有使用任何经验Python或任何其他程序。我试着寻找类似的问题,但我无法确定是否有任何问题是相同的,如果有任何解决方案可能适用于我的。所以对不起,如果这是重复的,我不知道。



但我在这里做错了什么,我需要做什么来解决这个问题? p>

npm install 会查找本地的 package.json 文件并从那里提供的列表安装依赖关系。在克隆你提到的项目之后,确保你 cd package.json 的位置并且尝试<$ c再次输入$ c> npm install 。

I'm not familiar with Python, NodeJS, NPM or Grunt, but I needed to install it because I want to try out a Github project.

I downloaded NodeJS from node.org and installed and tested it as described on this website. It seems to work because entering node and running a console.log worked.

I tried installing NPM with the following line

sudo npm install npm -g

..as said on the NPM website. This seemed to work.

Following directions from the Getting Started guide from the Grunt website had me updating NPM

npm update -g npm

and installing the CLI

npm install -g grunt-cli

which resulting in the following message:

/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
grunt-cli@0.1.13 /usr/local/lib/node_modules/grunt-cli
├── resolve@0.3.1
├── nopt@1.0.10 (abbrev@1.0.5)
└── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)

The second step of the directions on the github page "run npm install" turned out to be problematic. That results in these errors:

MacBook-Pro-van-Paul:~ Paul$ sudo npm install
npm ERR! install Couldn't read dependencies
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.10
npm ERR! path /Users/Paul/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34

npm ERR! package.json ENOENT, open '/Users/Paul/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Paul/npm-debug.log

Like I said, I have no experience whatsoever with using Python or any of the other programs. I've tried searching for a similar problem, but I can't really tell if any of the problems are the same and if any solution might work for mine. So sorry if this is duplicate, I am not aware.

But what am I doing wrong here and what do I need to do to resolve this?

解决方案

Your problem has nothing to do with Python, nor does the project you're trying to work with.

npm install will look for a local package.json file and install dependencies from the list supplied in there. After you clone the project you mentioned, make sure you cd to the location of package.json and try npm install again.

这篇关于安装nodejs npm和grunt会给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆