OWASP / threat-dragon

An open source threat modeling tool from OWASP
https://owasp.org/www-project-threat-dragon/
Apache License 2.0
889 stars 237 forks source link

使用npm start时发生错误 (An error occurred when using npm start) #328

Closed taoyiyang1 closed 2 years ago

taoyiyang1 commented 2 years ago

image 不知道怎么办了 help me

jgadsden commented 2 years ago

Hello @taoyiyang1

Can you check that you are using the following commands?

git clone git@github.com:OWASP/threat-dragon.git
cd threat-dragon
npm install
npm start

I have attached my console output for you to compare console.txt

The difference between our two builds is :

> threat-dragon-site@1.6.0 build:core
> ./node_modules/.bin/copyfiles --error --up 2 '../td.desktop/core/**/*' ./

where you seem to have an extra parameter to the build:core?

If it is still failing then I wonder if this is a problem with ./node_modules/.bin/copyfiles not managing with extended character sets in the path names on Windows ... so could you try again but using a source tree path such as : D:\temp\threat-dragon ? So that extended character set does not appear in the path

taoyiyang1 commented 2 years ago

你好@taoyiyang1

您可以检查您是否正在使用以下命令吗?

git clone git@github.com:OWASP/threat-dragon.git
cd threat-dragon
npm install
npm start

我附上了我的控制台输出供你比较 console.txt

我们两个版本之间的区别是:

> threat-dragon-site@1.6.0 build:core
> ./node_modules/.bin/copyfiles --error --up 2 '../td.desktop/core/**/*' ./

您似乎对 build:core 有一个额外的参数?

如果它仍然失败,那么我想知道这是否是./node_modules/.bin/copyfiles没有在 Windows 上的路径名中使用扩展字符集进行管理的问题......所以你能再试一次但使用源树路径,例如 : D:\temp\threat-dragon吗?这样扩展字符集就不会出现在路径中

你好@jgadsden 我使用以下命令 git clone --recursive git://github.com/owasp/threat-dragon.git npm install npm start

附上我的输出错误 console.txt

希望你能看一下,告诉我出错的原因

谢谢!

jgadsden commented 2 years ago

Hello @taoyiyang1 - the problem seems to be a dependency of dtrace-provider and node-gyp. It looks like it is searching for Python but can not find it. Can you install Python on your development machine?

Otherwise if you are just wanting to run Threat Dragon, rather than build it from source, then you can download from the releases area : https://github.com/OWASP/threat-dragon/releases

taoyiyang1 commented 2 years ago

你好@taoyiyang1 - 问题似乎是 dtrace-provider 和 node- gyp的依赖。看起来它正在搜索 Python 但找不到它。你能在你的开发机器上安装 Python 吗?

否则,如果您只想运行 Threat Dragon,而不是从源代码构建它,那么您可以从发布区下载:https : //github.com/OWASP/threat-dragon/releases

好的,我现在来安装,谢谢你的回答

taoyiyang1 commented 2 years ago

你好@taoyiyang1 - 问题似乎是 dtrace-provider 和 node- gyp的依赖。看起来它正在搜索 Python 但找不到它。你能在你的开发机器上安装 Python 吗?

否则,如果您只想运行 Threat Dragon,而不是从源代码构建它,那么您可以从发布区下载:https : //github.com/OWASP/threat-dragon/releases

你好 @jgadsden 我已经成功安装了 Python 运行npm install npm start控制台依旧报错

控制台错误信息 console.txt

因为需要不得不从源代码构建,希望你能帮到我

谢谢

taoyiyang1 commented 2 years ago

hello @jgadsden

I used VS to run the NPM install command successfully, but still reported an error when using the NPM start command, as shown in the top image

console message console.txt

jgadsden commented 2 years ago

Hello @taoyiyang1 , thankyou for looking into this. I will try and repeat your issue soon. I run MacOS and Linux, but not Windows, so repeating this problem is not so easy for me. I have an old and cranky Windows box that I will get out and see if I can repeat this.

It seems copyfiles is broken for some reason. Just to get you going do you want to replace line 6 in td.site\package.json from "build": "npm-run-all clean build:css build:min build:fonts build:core bundle", to "build": "npm-run-all clean build:css build:min build:fonts bundle",

and then copy manually the core directory and directories under it to td.site? So copy td.desktop\core and all sub-dirs to td.site\core using your file manager

@andk123 or @lreading I guess you are OK building on your Windows machines?

taoyiyang1 commented 2 years ago

hello @jgadsden Using the method you provided, I ran it successfully,But there was an error after login authorization,Could you please help me find out what the reason is? How to solve

image

jgadsden commented 2 years ago

Hello @taoyiyang1 - we are getting closer, good to see. Have you followed the env instructions here: https://github.com/OWASP/threat-dragon/blob/main/setup-env.md

taoyiyang1 commented 2 years ago

你好@taoyiyang1 - 我们越来越近了,很高兴看到。您是否按照此处的 env 说明进行操作:https : //github.com/OWASP/threat-dragon/blob/main/setup-env.md

hello @jgadsden

Yes, I created the OAuth application as documented, I don't know why I still get an error , I would like to know your private email address, let you have a look at the Settings in OAuth and the contents in. Env file

taoyiyang1 commented 2 years ago

hello @jgadsden

I have logged in successfully. The previous login error may be due to network reasons. Because I use a VPN proxy, I sometimes get login errors.

I did this according to the online method, do you think it is effective td.serve\src\config\passport.config

image

jgadsden commented 2 years ago

Superb @taoyiyang1 , I was getting round to replying to your earlier error but you have now fixed. it. Very interesting that you had a problem when working on a VPN - did you want to raise an issue for this specifically? It may be that we need another env setting for 'proxy' true or false (probably called something like GITHUB_PROXY)

There is still the problem you found with npm install in your environment. I will try and repeat this today and get back to you on what I find

Thanks again for your perseverance with Threat Dragon!

jgadsden commented 2 years ago

Many thanks for this @taoyiyang1 , and I can confirm what you see on my Windows machine as well. I will try and work back to find where these problems were introduced.

There are probably at least two issues to be raised - thanks again!

taoyiyang1 commented 2 years ago

hello @jgadsden How can I get in touch with you.?

jgadsden commented 2 years ago

Hello @taoyiyang1 - sure, contact me any time at jon.gadsden@owasp.org. The contact details of the Threat Dragon leaders are listed at : https://owasp.org/www-project-threat-dragon/

thanks again for the issues you have found

taoyiyang1 commented 2 years ago

hello@jgadsden I have sent you an email. I don't know if you have received it. The email suffix is QQ.com