运行npm启动时,启动脚本丢失错误(Start script missing error when running npm start)
尝试使用npm start命令调试我的节点应用程序时收到此错误。
错误:
npm ERR! Windows_NT 6.3.9600 npm错误! argv“C:\ Program Files \ nodejs \\ node.exe”“C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js”“start”npm ERR! 节点v0.12.7 npm ERR! npm v2.11.3
npm ERR! 缺少脚本:start npm ERR! npm ERR! 如果您需要帮助,可以在以下地址报告此错误:npm ERR! https://github.com/npm/npm/issues npm ERR! 请包含以下文件与任何支持请求:npm ERR! C:\ Users \用户andrmoll.NORTHAMERICA \文档\ GitHub的\ SVIChallenge \ NPM-的debug.log
从调试文件:
详细堆栈错误:缺少脚本:启动
4在运行时的详细堆栈(C:\ Program Files \ nodejs \ node_modules \ npm \ lib \ run-script.js:142:19)
在C:\ Program Files \ nodejs \ node_modules \ npm \ lib \ run-script.js:58:5的详细堆栈
4在C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:345:5的详细堆栈
4 checkBinReferences_(C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:309:45)中的详细堆栈
4最终的详细堆栈(C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:343:3)
4在这里的详细堆栈(C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:113:5)
4在C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ read-package-json \ read-json.js:300:12的详细堆栈
4个详细的堆栈在evalmachine.:334:14
4在C:\ Program Files \ nodejs \ node_modules \ npm \ node_modules \ graceful-fs \ graceful-fs.js:102:5中的详细堆栈
4详细堆栈在FSReqWrap.oncomplete(evalmachine.:95:15)
I'm receiving this error when trying to debug my node application using the npm start command.
Error:
npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR! node v0.12.7 npm ERR! npm v2.11.3
npm ERR! missing script: start npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issuesnpm ERR! Please include the following file with any support request: npm ERR! C:\Users\andrmoll.NORTHAMERICA\Documents\GitHub\SVIChallenge\npm-debug.log
From the debug file:
verbose stack Error: missing script: start
4 verbose stack at run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:142:19)
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:58:5
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:345:5
4 verbose stack at checkBinReferences_ (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:309:45)
4 verbose stack at final (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:343:3)
4 verbose stack at then (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:113:5)
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:300:12
4 verbose stack at evalmachine.:334:14
4 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:102:5
4 verbose stack at FSReqWrap.oncomplete (evalmachine.:95:15)
原文:https://stackoverflow.com/questions/31976722
最满意答案
尝试运行
mvn -Prelease-profile help:effective-pom
。 你会发现你有两个执行部分的maven-source-plugin
输出将如下所示:
<plugin> <artifactId>maven-source-plugin</artifactId> <version>2.0.4</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> <execution> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
要解决这个问题,请找到你使用
maven-source-plugin
,并确保使用“id”附加源,使其与发行版配置文件相同。 然后这些部分将被合并。最佳实践说,为了获得一致性,您需要在build> pluginManagement中的项目的根POM中配置,而不是在您的孩子pom中。 在孩子pom中,您只需要在build>插件中指定要使用maven-source-plugin的插件,但不提供执行。
在房间pom.xml中:
<build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <!-- This id must match the -Prelease-profile id value or else sources will be "uploaded" twice, which causes Nexus to fail --> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </pluginManagement> </build>
在小孩pom.xml中:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> </plugin> </plugins> </build>
Try running
mvn -Prelease-profile help:effective-pom
. You will find that you have two execution sections formaven-source-plugin
The output will look something like this:
<plugin> <artifactId>maven-source-plugin</artifactId> <version>2.0.4</version> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> <execution> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
To fix this problem, find everywhere you have used
maven-source-plugin
and make sure that you use the "id" attach-sources so that it is the same as the release profile. Then these sections will be merged.Best practice says that to get consistency you need to configure this in the root POM of your project in build > pluginManagement and NOT in your child poms. In the child pom you just specify in build > plugins that you want to use maven-source-plugin but you provide no executions.
In the room pom.xml:
<build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <!-- This id must match the -Prelease-profile id value or else sources will be "uploaded" twice, which causes Nexus to fail --> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </pluginManagement> </build>
In the child pom.xml:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> </plugin> </plugins> </build>
相关问答
更多-
Maven版本插件失败:源工件被部署两次(Maven release plugin fails : source artifacts getting deployed twice)[2023-08-03]
尝试运行mvn -Prelease-profile help:effective-pom 。 你会发现你有两个执行部分的maven-source-plugin 输出将如下所示:maven-source-plugin 2.0.4 attach-sources ... -
您可以更新您的构建定义以生成Web部署包并将其上传到工件。 然后在发布管理中,添加一个任务以在部署包中运行“projectname.deploy.cmd”以将其部署到您的IIS服务器。 有关详细信息,请参阅此链接: 如何使用Visual Studio创建的deploy.cmd文件安装部署包 。 您也可以在IIS服务器上启用FTP发布 ,并在发布中添加任务以通过FTP发布工件。 您可能需要此任务: FTP上传器 。 You can update your build definition to generat ...
-
您可以使用不同类型/分类器安装其他工件。 使用build-helper-maven-plugin的 attach-artifact目标来实现这一目标。 这是一个小例子 - 我们正在将产品的Windows和Unix安装程序部署为windows / exe和unix / sh文件。 这些文件将安装到本地存储库并部署到分发管理。
org.codehaus.mojo build-helper-maven-plugin ... -
使用releaseProfiles参数(例如: src,javadoc )打开一个或多个配置文件,并在这些配置文件中定义源代码和javadoc代:
src org.apache.maven.plugins ... -
使用分类器部署工件时,Maven部署到Nexus失败(Maven Deploy to Nexus Fails When Deploying Artifact with Classifier)[2023-09-30]
此问题是由IIS代理中的请求筛选限制引起的。 默认情况下,允许的最大内容长度为30 MB。 这阻止了我的约90 MB的jar文件。 将限制增加到512 MB可解决问题。 This issue was caused by request filtering limits in an IIS proxy. By default, the maximum allowed content length was 30 MB. This was blocking my post of a ~90 MB jar file ... -
我发现了一个对我有用的解决方法:插件会创建一些环境变量。 其中大多数是自动给出和创建的,并且可以在选项点“maven release build”的高级设置中编辑一个(IS_M2RELEASEBUILD) 我的解决方案 1.)检查构建环境中的“Maven发布版本”,以便稍后访问某些值。 2.)创建“条件步骤(单个)”作为前置步骤和后续步骤 2.1)两者都应该有一个带有标记的布尔条件:$ {ENV,var =“IS_M2RELEASEBUILD”} 2.2)两者都应该将“调用Maven目标”作为构建步骤。 预 ...
-
@VonC的上述答案帮助我解决了这个问题。 我在settings.xml文件中输入的服务器ID和Jenkins artifactory配置不匹配。 我做了如下所列的以下更改。 首先,我更新了我的Jenkins artifactory配置,如下所示。 REPOSITORY ID必须与settings.xml文件中提到的服务器ID完全匹配:
admin AP447H6DXXJW6WW54BvNBorau5s< ... -
Jenkins M2发布插件(使用maven的maven-release-plugin)。 如果您已经创建了Maven作业(而不是自由样式),那么在作业配置的M2 Release部分中,您将看到目标是: -Dresume=false release:prepare release:perform 如果您使用以下M2版本替换它,插件将不会调用由发布启动的部署目标:默认情况下执行目标。 -Dresume=false release:prepare release:perform -Darguments="- ...
-
首先,您正在使用模块并尝试在父pom中执行奇怪的操作(dependency-plugin,build-helper等)。 在父母身上,永远不应该像你在pom中那样执行。 您应该在适当的模块中进行适当的配置/执行,因为这个定义将继承所有子项。 你想创建一个ear文件吗? 你应该使用包装ear ,你的耳朵文件只需使用mvn deploy 。 此外,如果你打电话,你似乎误解了生命周期的原因: mvn clean package deploy 这可以简化为: mvn clean deploy 因为包生命周期是部 ...
-
这个问题真的不是真的。 它更多关于svn本身。 当svn发送此错误消息时,Maven停止其操作: svn:' http:// myserver / myproject / sandbox / release-test '的选项:200 OK( http:// myserver ) 您是否绝对确定http://myserver/myproject/sandbox/release-test地址? 如果http://myserver/myproject/sandbox/release-test不存在,svn将不会 ...