NPM run * 不做任何事情 [英] NPM run * doesn't do anything

查看:23
本文介绍了NPM run * 不做任何事情的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个 Electron 项目,一切正常.但是现在,当我运行 package.json 中的任何脚本(包括 npm start)时,它只会转义一行,什么也不做.

I was running an Electron project, and everything worked just fine. But now when I run any of the scripts in my package.json (including npm start), it just escapes a line and doesn't do anything.

我的 package.json:

My package.json:

{
  "name": "interclip-desktop",
  "version": "0.0.7",
  "description": "Interclip for desktop",
  "repository": "https://github.com/aperta-principium/Interclip-desktop",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "package-mac": "electron-packager . --overwrite --asar=true --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds",
    "package-win": "electron-packager . Interclip --overwrite --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="Interclip"",
    "package-linux": "electron-packager . Interclip --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/icon.png --prune=true --out=release-builds",
    "win-install": "node installers/windows/createinstaller.js",
    "postinstall": "electron-builder install-app-deps",
    "build": "electron-builder --linux",
    "release": "electron-builder --linux --publish always"
  },
  "keywords": [
    "Desktop",
    "Interclip"
  ],
  "author": "Filip Troníček",
  "license": "MIT",
  "devDependencies": {
    "electron": "^7.1.2",
    "electron-builder": "^22.1.0",
    "electron-installer-dmg": "^3.0.0",
    "electron-packager": "^14.1.1",
    "electron-reload": "^1.5.0",
    "electron-winstaller": "^4.0.0"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "mousetrap": "^1.6.3"
  },
  "build": {
    "appId": "com.aperta-principium.interclip",
    "productName": "Interclip",
    "mac": {
      "category": "public.app-category.utilities"
    },
    "dmg": {
      "icon": false
    },
    "linux": {
      "target": [
        "AppImage"
      ],
      "category": "Utility"
    }
  }
}

我尝试更新 NPM,没有用.当我在不同的项目中尝试时,也不起作用.

I tried updating NPM, didn't work. When I tried in different projects, also doesn't work.

提前致谢

推荐答案

npm 有一个 ignore-scripts 配置键.它的预期值为布尔值,默认设置为 false.

npm has a ignore-scripts configuration key. It's expected value is a Boolean and it's set to false by default.

也许无意中将其设置为 true.

Perhaps it has inadvertently been set to true.

get/set ignore-scripts 配置,您可以使用npm-config 命令:

To get/set the ignore-scripts configuration you can utilize the npm-config command:

  1. 通过运行检查其当前设置:

  1. Check its current setting by running:

npm config get ignore-scripts

  • 如果上述命令返回true,则通过运行将其重置为false:

  • If the aforementioned command returns true then reset it to false by running:

    npm config set ignore-scripts false
    

  • 这篇关于NPM run * 不做任何事情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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