npm 错误!无效的包名称“__init__.py”:名称不能以下划线开头

时间:2021-07-27 11:40:55

标签: node.js npm

我正在尝试从 jenkins 运行黄瓜/小黄瓜脚本 我正在使用节点 java 脚本来执行小黄瓜脚本。 我正进入(状态 npm 错误!无效的包名称“init.py”:名称不能以下划线开头

package.json

{
    "name": "My test App",
    "description": "My test App",
    "scripts": {
        "cleanlogs": "rm -rf reports/html/* && rm -rf reports/json/* && mkdir -p reports/html && mkdir -p reports/json",
        "setenv": "STACK=* TAGS=@automated",
        "test:integration": "./node_modules/cucumber/bin/cucumber-js ./test/features/$STACK -r ./test/support/env/init/env-init.js  -r ./test/step_definitions/ -f json:reports/json/reports.json --colorsEnabled true --tags \"$TAGS\" ",
        "pretest": "npm run cleanlogs && npm run setenv",
        "posttest": "node test/support/util/generate-html-reportV2.js ",
        "test": "npm run test:integration || :"
    },
    "dependencies": {
        "@cucumber-e2e/html-reporter": "0.2.1",
        "@serenity-js/core": "1.6.0",
        "amazon-cognito-identity-js": "3.0.12",
        "aws-sdk": "2.473.0",
        "chai": "4.2.0",
        "chalk": "2.4.2",
        "child_process": "1.0.2",
        "https-proxy-agent": "2.2.1",
        "is-my-json-valid": "2.20.0",
        "jsonpath-plus": "0.20.1",
        "lodash": "^4.17.20",
        "npm": "6.9.0",
        "path": "0.12.7",
        "prettyjson": "1.2.1",
        "request": "2.88.0",
        "sftp-upload": "1.0.1",
        "ssh2-sftp-client": "^5.3.1",
        "swagger-tools": "0.10.4",
        "uuid": "3.3.2",
        "winston": "3.2.1",
        "xmldom": "0.1.27",
        "xpath.js": "1.1.0"
    },
    "devDependencies": {
        "cross-env": "^7.0.0",
        "cucumber": "5.1.0",
        "cucumber-html-reporter": "5.0.0",
        "eslint": "5.16.0",
        "eslint-config-google": "0.13.0",
        "fs-promise": "2.0.3",
        "multiple-cucumber-html-reporter": "1.11.8",
        "run-sequence": "2.2.1",
        "serenity-cli": "0.11.3",
        "unicode-9.0.0": "0.7.5"
    }
}

1 个答案:

答案 0 :(得分:0)

找到根本原因。我发现

init.py”:{} 在 package-lock.json 中 删除此行后,它起作用了。