Git Product home page Git Product logo

Comments (4)

ruanyf avatar ruanyf commented on April 28, 2024 6

.git/hooks目录下的所有文件都删掉。

from jstraining.

aladdin-add avatar aladdin-add commented on April 28, 2024 2

首先,这并不是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.

fuchao2012 avatar fuchao2012 commented on April 28, 2024

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.

monster-wang-aws avatar monster-wang-aws commented on April 28, 2024

@fuchao2012
这点我就觉得很迷 项目根目录是 jstraining 的话,哪来的 package.json 呢?

from jstraining.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.