Comments (4)
把.git/hooks
目录下的所有文件都删掉。
from jstraining.
首先,这并不是npm的错误。git commit
默认是不会执行lint的,除非你使用了git hooks 。
一般情况下,如果你没有手动修改这些文件,很有可能是某些npm包修改了它(eg. [pre-commit])(https://www.npmjs.com/package/pre-commit)
因为git hooks位于.git
目录,不会提交到git仓库,所以别人不会复现你的问题。
解决方案:
-
方案1:使用
git commit -n
来提交 -
方案2: 删除.
git/hooks
目录下所有文件 -
方案3:最暴力的方法,删除
.git
目录,然后重新执行git init
(所有的提交历史都会丢失)
from jstraining.
npm run 是一体的 run 后边跟着你 package.json 文件里 scirpt 底下的 指令。例如
$ npm run test
$ npm run dev
$ npm run build
另外,package.json 是你的 项目根目录
不是系统目录,比如
# 你新建了一个项目叫做 test-npm, 并在里面初始化你的 package.json(或者自己手写一个)
$ mkdir test-npm && cd $_
$ npm init
此刻打开你喜欢的编辑器,就能在这个目录下找到 package.json
了
冒昧作答,请 @ruanyf 大大指正(:
from jstraining.
@fuchao2012
这点我就觉得很迷 项目根目录是 jstraining 的话,哪来的 package.json 呢?
from jstraining.
Related Issues (20)
- 小微学院任务3
- 小微学院任务4
- img
- xiaoweirenwu3
- mocha-demo HOT 1
- react-mbox 目录下npm start 时报错 HOT 1
- 安装nightmare依赖出现问题 HOT 3
- 那么前端工程师的未来在哪 HOT 8
- 实操项目simple-app-demo中的npm run build导致失败的原因 HOT 1
- 阮一峰老师有没有关于 gitlab 的持续集成以及 gitlab 配合美杜莎的持续部署教程啊 HOT 1
- Assertion failed: frame_header.payload_length == sizeof xfer_info, file src\win\pipe.c HOT 1
- 使用postman发送请求时的问题 HOT 3
- ways to visit example
- 请教闭包问题 HOT 2
- 我也遇到这个问题了,无法解决,自己去淘宝网搜索正常的 HOT 2
- mobx-demo/redux-demo 无法运行 HOT 8
- react-component-demo 在浏览器运行控制台报错 HOT 1
- 开发者的手册里css3动画篇的ifream都挂了哦 HOT 1
- 老师为什么不用koa
- 请教 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jstraining.