• npm中执行shell脚本提示: git commit -m "add " husky > npm run -s precommit (node v14.4.0) '.' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 husky > pre-commit hook failed (add --no-verify to bypass)


    [备忘录]npm中执行shell脚本提示: git commit -m "add " husky > npm run -s precommit (node v14.4.0) '.' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 husky > pre-commit hook failed (add --no-verify to bypass)

    win10运行前端项目可能遇到以下情况

    PS ...> yarn precommit
    yarn run v1.22.4
    $ ./build/pre-commit-lint.sh
    Done in 1.26s.
    PS ...> git commit -m "add "
    husky > npm run -s precommit (node v14.4.0)
    
    '.' 不是内部或外部命令,也不是可运行的程序
    或批处理文件。
    
    husky > pre-commit hook failed (add --no-verify to bypass)
    

    解决办法

    修改package.json,在precommit加上 sh ./build...
    package.json

        "build": "node build/build.js",
        "build:staging": "cross-env NODE_ENV=staging node build/build.js",
        "release": "bash build/release.sh",
        "release:staging": "cross-env NODE_ENV=staging bash build/release.sh",
        "precommit": "./build/pre-commit-lint.sh"
      },
      "dependencies": {
        "axios": "^0.19.2",
        "vue": "^2.5.16",
        "vue-router": "^3.3.4
    

    修改后package.json

        "build": "node build/build.js",
        "build:staging": "cross-env NODE_ENV=staging node build/build.js",
        "release": "bash build/release.sh",
        "release:staging": "cross-env NODE_ENV=staging bash build/release.sh",
        "precommit": "sh ./build/pre-commit-lint.sh"
      },
      "dependencies": {
        "axios": "^0.19.2",
        "vue": "^2.5.16",
        "vue-router": "^3.3.4
    
  • 相关阅读:
    mysql自增长字段设置
    查看docker的挂载目录
    centos rpm安装jdk1.8
    mybatis-地区三表生成地区树
    post表单、json接口
    git子模块使用
    解决Windows系统80端口被占用
    交换机基础命令
    JMX协议
    WMI协议
  • 原文地址:https://www.cnblogs.com/WNpursue/p/13206349.html
Copyright © 2020-2023  润新知