`哟angular`给出错误:NPM ERR! code ENOENT NPM ERR!错误号34(是的,我已经清理缓存和.npmignore设置) [英] `yo angular` gives error: npm ERR! code ENOENT npm ERR! errno 34 (yes I have cleaned the cache and set .npmignore)

查看:678
本文介绍了`哟angular`给出错误:NPM ERR! code ENOENT NPM ERR!错误号34(是的,我已经清理缓存和.npmignore设置)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个新的项目目录中运行哟角,但它的地方给我的错误ENOENT沿途。是的,我已经看过这个类似的问题,但它的解决方案没有按'对我来说将不起作用。

I tried to run yo angular in a new project directory, but it gave me the ENOENT error somewhere along the way. Yes I have looked at this similar question, but its solution doesn't work for me.

我的权利运行前跑空的新项目目录这些事情哟角

I ran these things on the empty new project directory right before running yo angular:

touch .npmignore
npm cache clear
npm cache clean

但我仍然得到:

npm ERR! Error: ENOENT, lstat '/home/ubuntu/app_c/node_modules/grunt/    internal-tasks/bump.js'
npm ERR! If you need help, you may report this *entire* log, 
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.2.0-54-virtual
npm ERR! command "/home/ubuntu/local/bin/node" "/home/ubuntu/local/bin/  npm" "install"
npm ERR! cwd /home/ubuntu/app_c
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /home/ubuntu/app_c/node_modules/grunt/internal-tasks/bump. js
npm ERR! fstream_path /home/ubuntu/app_c/node_modules/grunt/internal-    tasks/bump.js
npm ERR! fstream_type File 
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /home/ubuntu/local/lib/node_modules/npm/          node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)

我怎样才能解决这个问题?

How can I fix it?

下面是所有命令的历史,按时间顺序,我跑一个全新的Ubuntu服务器12.04 3,所以你可以看到究竟是什么导致了这一点,我已经安装位置不同软件包。

Here is the history of ALL the commands, in chronological order, that I ran on a brand new Ubuntu Server 12.04.3, so you can see exactly what led up to this point, and where I have installed various packages.

此问题链接到故宫 GitHub的问题

推荐答案

编辑: NPM更新-g 然后按 NPM缓存清除应适用于大多数。然而,第一次安装在Mac OS时,您可能需要导航到 USR / local / lib目录/ node_modules 文件夹一次的NodeJS首次安装并授予读/写权限每个人。节点将不能够安装附加的工作流程组件全局直到这些权限被释放。你不想给须藤故宫安装命令,因为那时这些工具不会有sudo访问的事实之后运行。读/写权限被改变右键单击该文件夹并进入获取信息,然后在弹出的底部更改权限。

npm update -g followed by npm cache clear should work for most. However, when first installing on Mac OS you may need to navigate to your usr/local/lib/node_modules folder once nodeJS is first installed and grant read/write permission to "Everyone". Node won't be able to installed additional workflow components globally until those permissions are released. You don't want to sudo the npm install commands, because then those tools won't have sudo access to run after the fact. Read/write permissions are changed by right-clicking the folder and going to "Get info" then changing permissions at bottom of popup.

我的Windows 7机器上同样的问题。下面是步骤我把解决:

I had this same issue on Windows 7 machine. Here are the steps I took to resolve:


  • 修复节点安装

  • 开启升高CLI

  • 运行 NPM更新-g

  • 运行 NPM缓存清除

  • 运行 NPM安装-g哟

  • 运行 NPM缓存清除

  • 运行 NPM安装-g生成角

  • 运行 NPM缓存清除

  • 创建新的目录

  • 运行哟角测试

  • 运行 NPM缓存清除

  • 运行咕噜服务

  • repair Node installation
  • open elevated cli
  • run npm update -g
  • run npm cache clear
  • run npm install -g yo
  • run npm cache clear
  • run npm install -g generator-angular
  • run npm cache clear
  • created new directory
  • run yo angular test
  • run npm cache clear
  • run grunt serve

我也碰到一些其他问题与karma.conf.js如果路径有一个 \\ 而不是 / 对于bower_components。另外,我注意到了可选的角度模块是在我的app.js尽管这还不包括他们在我的哟构建从CLI注入。我已经报告在GitHub上这些问题。

I did run into some other issues with karma.conf.js where the paths had a \ instead of / for bower_components. Also, I noticed the optional angular modules were injected in my app.js despite not including them all in my yo build from the cli. I have reported these issues on github.

这篇关于`哟angular`给出错误:NPM ERR! code ENOENT NPM ERR!错误号34(是的,我已经清理缓存和.npmignore设置)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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