Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ASP.NETCore Yoeman和Dotnet CLI示例对我来说是开箱即用的失败,为什么>;_Javascript_Asp.net Core_Dotnet Cli - Fatal编程技术网

Javascript ASP.NETCore Yoeman和Dotnet CLI示例对我来说是开箱即用的失败,为什么>;

Javascript ASP.NETCore Yoeman和Dotnet CLI示例对我来说是开箱即用的失败,为什么>;,javascript,asp.net-core,dotnet-cli,Javascript,Asp.net Core,Dotnet Cli,我是一个尝试将我的JavaScript技能用于ASP.NET核心的新手 使用Yoeman,我在执行以下步骤后得到一个错误: npm install -g yo generator-aspnetcore-spa npm install -g webpack yo aspnetcore-spa 错误是: Error: Cannot find module 'temp' at Function.Module._resolveFilename (modu

我是一个尝试将我的JavaScript技能用于ASP.NET核心的新手

使用Yoeman,我在执行以下步骤后得到一个错误:

    npm install -g yo generator-aspnetcore-spa
    npm install -g webpack
    yo aspnetcore-spa
错误是:

    Error: Cannot find module 'temp'
        at Function.Module._resolveFilename (module.js:469:15)
        at Function.Module._load (module.js:417:25)
        at Module.require (module.js:497:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (C:\Users\Bruce\AppData\Roaming\npm\node_modules\yo\node_modules\external-editor\main\index.js:15:10)
        at Object.<anonymous> (C:\Users\Bruce\AppData\Roaming\npm\node_modules\yo\node_modules\external-editor\main\index.js:136:4)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)

What should I do to fix this?
    Hosting environment: Development
    Content root path: C:\Users\Bruce\Dropbox\Projects MoneyPlan\MyNewThing
    Now listening on: http://localhost:5000
    Application started. Press Ctrl+C to shut down.
    fail: Microsoft.AspNetCore.NodeServices[0]
          (node:10072) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
    fail: Microsoft.AspNetCore.NodeServices[0]

          parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
    fail: Microsoft.AspNetCore.NodeServices[0]
          [at-loader] Checking finished with 1 errors
    fail: Microsoft.AspNetCore.NodeServices[0]
          [at-loader] Checking finished with 1 errors
    info: Microsoft.AspNetCore.NodeServices[0]
          webpack built f9fa10795e41d7865b35 in 12041ms
    info: Microsoft.AspNetCore.NodeServices[0]
          Hash: f9fa10795e41d7865b35
          Version: webpack 2.5.1
          Time: 12041ms
                       Asset      Size  Chunks                    Chunk Names
              main-client.js    299 kB       0  [emitted]  [big]  main-client
                    site.css   1.56 kB       0  [emitted]         main-client
          main-client.js.map    333 kB       0  [emitted]         main-client
                site.css.map  85 bytes       0  [emitted]         main-client
          chunk    {0} main-client.js, site.css, main-client.js.map, site.css.map (main-client) 244 kB [entry] [rendered]
              [0] external "vendor_609a3b1255e87fe0584f" 42 bytes {0} [not cacheable]
              [1] delegated ./node_modules/react/react.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
             [59] ./ClientApp/boot-client.tsx 938 bytes {0} [built]
             [60] (webpack)-hot-middleware/client.js?path=%2F__webpack_hmr 6.68 kB {0} [built]
             [61] delegated ./node_modules/event-source-polyfill/eventsource.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
             [69] ./ClientApp/configureStore.ts 1.35 kB {0} [built]
             [70] ./ClientApp/routes.tsx 743 bytes {0} [built]
             [71] ./ClientApp/css/site.css 41 bytes {0} [built]
            [177] ./~/strip-ansi/index.js 161 bytes {0} [built]
            [178] (webpack)-hot-middleware/client-overlay.js 1.82 kB {0} [built]
            [179] (webpack)-hot-middleware/process-update.js 3.88 kB {0} [built]
            [180] delegated ./node_modules/bootstrap/dist/js/npm.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
            [182] delegated ./node_modules/react-dom/index.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
            [186] delegated ./node_modules/querystring-es3/index.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
            [189] multi event-source-polyfill webpack-hot-middleware/client?path=%2F__webpack_hmr ./ClientApp/boot-client.tsx 52 bytes {0} [built]
               + 175 hidden modules

          ERROR in [at-loader] ./ClientApp/components/Layout.tsx:13:21
              TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<NavMenu> & { children?: ReactNode; } & void'.
            Type '{}' is not assignable to type 'void'.
          Child extract-text-webpack-plugin:
              chunk    {0} extract-text-webpack-plugin-output-filename 3.32 kB [entry] [rendered]
                  [0] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
                  [1] ./~/css-loader!./ClientApp/css/site.css 1.81 kB {0} [built]
错误是:

    Error: Cannot find module 'temp'
        at Function.Module._resolveFilename (module.js:469:15)
        at Function.Module._load (module.js:417:25)
        at Module.require (module.js:497:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (C:\Users\Bruce\AppData\Roaming\npm\node_modules\yo\node_modules\external-editor\main\index.js:15:10)
        at Object.<anonymous> (C:\Users\Bruce\AppData\Roaming\npm\node_modules\yo\node_modules\external-editor\main\index.js:136:4)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)

What should I do to fix this?
    Hosting environment: Development
    Content root path: C:\Users\Bruce\Dropbox\Projects MoneyPlan\MyNewThing
    Now listening on: http://localhost:5000
    Application started. Press Ctrl+C to shut down.
    fail: Microsoft.AspNetCore.NodeServices[0]
          (node:10072) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
    fail: Microsoft.AspNetCore.NodeServices[0]

          parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
    fail: Microsoft.AspNetCore.NodeServices[0]
          [at-loader] Checking finished with 1 errors
    fail: Microsoft.AspNetCore.NodeServices[0]
          [at-loader] Checking finished with 1 errors
    info: Microsoft.AspNetCore.NodeServices[0]
          webpack built f9fa10795e41d7865b35 in 12041ms
    info: Microsoft.AspNetCore.NodeServices[0]
          Hash: f9fa10795e41d7865b35
          Version: webpack 2.5.1
          Time: 12041ms
                       Asset      Size  Chunks                    Chunk Names
              main-client.js    299 kB       0  [emitted]  [big]  main-client
                    site.css   1.56 kB       0  [emitted]         main-client
          main-client.js.map    333 kB       0  [emitted]         main-client
                site.css.map  85 bytes       0  [emitted]         main-client
          chunk    {0} main-client.js, site.css, main-client.js.map, site.css.map (main-client) 244 kB [entry] [rendered]
              [0] external "vendor_609a3b1255e87fe0584f" 42 bytes {0} [not cacheable]
              [1] delegated ./node_modules/react/react.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
             [59] ./ClientApp/boot-client.tsx 938 bytes {0} [built]
             [60] (webpack)-hot-middleware/client.js?path=%2F__webpack_hmr 6.68 kB {0} [built]
             [61] delegated ./node_modules/event-source-polyfill/eventsource.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
             [69] ./ClientApp/configureStore.ts 1.35 kB {0} [built]
             [70] ./ClientApp/routes.tsx 743 bytes {0} [built]
             [71] ./ClientApp/css/site.css 41 bytes {0} [built]
            [177] ./~/strip-ansi/index.js 161 bytes {0} [built]
            [178] (webpack)-hot-middleware/client-overlay.js 1.82 kB {0} [built]
            [179] (webpack)-hot-middleware/process-update.js 3.88 kB {0} [built]
            [180] delegated ./node_modules/bootstrap/dist/js/npm.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
            [182] delegated ./node_modules/react-dom/index.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
            [186] delegated ./node_modules/querystring-es3/index.js from dll-reference vendor_609a3b1255e87fe0584f 42 bytes {0} [not cacheable] [built]
            [189] multi event-source-polyfill webpack-hot-middleware/client?path=%2F__webpack_hmr ./ClientApp/boot-client.tsx 52 bytes {0} [built]
               + 175 hidden modules

          ERROR in [at-loader] ./ClientApp/components/Layout.tsx:13:21
              TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<NavMenu> & { children?: ReactNode; } & void'.
            Type '{}' is not assignable to type 'void'.
          Child extract-text-webpack-plugin:
              chunk    {0} extract-text-webpack-plugin-output-filename 3.32 kB [entry] [rendered]
                  [0] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
                  [1] ./~/css-loader!./ClientApp/css/site.css 1.81 kB {0} [built]
托管环境:开发
内容根路径:C:\Users\Bruce\Dropbox\Projects MoneyPlan\MyNewThing
现在收听:http://localhost:5000
应用程序已启动。按Ctrl+C组合键关闭。
失败:Microsoft.AspNetCore.NodeServices[0]
(节点:10072)弃用警告:loaderUtils.parseQuery()收到一个可能有问题的非字符串值,请参阅https://github.com/webpack/loader-utils/issues/56
失败:Microsoft.AspNetCore.NodeServices[0]
在loader utils的下一个主要版本中,parseQuery()将替换为getOptions()。
失败:Microsoft.AspNetCore.NodeServices[0]
[at loader]检查已完成,但有1个错误
失败:Microsoft.AspNetCore.NodeServices[0]
[at loader]检查已完成,但有1个错误
信息:Microsoft.AspNetCore.NodeServices[0]
网页包在12041ms内构建f9fa10795e41d7865b35
信息:Microsoft.AspNetCore.NodeServices[0]
散列:f9fa10795e41d7865b35
版本:网页2.5.1
时间:12041ms
资产大小块块名称
main-client.js 299 kB 0[emissed][big]主客户端
site.css 1.56 kB 0[emissed]主客户端
main-client.js.map 333 kB 0[emissed]主客户端
site.css.map 85字节0[已发出]主客户端
区块{0}main-client.js,site.css,main-client.js.map,site.css.map(主客户端)244KB[输入][呈现]
[0]外部“vendor_609a3b1255e87fe0584f”42字节{0}[不可缓存]
[1] 委托./node_modules/react/react.js,来自dll参考供应商_609a3b1255e87fe0584f 42字节{0}[不可缓存][构建]
[59]。/ClientApp/boot-client.tsx 938字节{0}[builded]
[60](webpack)-热中间件/client.js?路径=%2F_uuwebpack_hmr 6.68 kB{0}[构建]
[61]来自dll参考供应商的委托./node_modules/event source polyfill/eventsource.js_609a3b1255e87fe0584f 42字节{0}[不可缓存][构建]
[69]。/ClientApp/configureStore.ts 1.35 kB{0}[编译]
[70]。/ClientApp/routes.tsx 743字节{0}[编译]
[71]。/ClientApp/css/site.css 41字节{0}[编译]
[177]./~/strip ansi/index.js 161字节{0}[Build]
[178](网页包)-热中间件/client-overlay.js 1.82 kB{0}[构建]
[179](网页包)-热中间件/process-update.js 3.88 kB{0}[构建]
[180]来自dll参考供应商的委托./node_modules/bootstrap/dist/js/npm.js_609a3b1255e87fe0584f 42字节{0}[不可缓存][构建]
[182]来自dll参考供应商的委托./node_modules/react dom/index.js_609a3b1255e87fe0584f 42字节{0}[不可缓存][已构建]
[186]已委托./node_modules/querystring-es3/index.js,来自dll参考供应商_609a3b1255e87fe0584f 42字节{0}[不可缓存][已构建]
[189]多事件源polyfill webpack热中间件/客户端?路径=%2F_uuWebpack_hmr./ClientApp/boot-client.tsx 52字节{0}[构建]
+175个隐藏模块
[at loader]./ClientApp/components/Layout中出错。tsx:13:21
TS2322:类型“{}”不可分配给类型“IntrinsicatAttributes&IntrinsicClassAttributes&{children?:ReactNode;}&void”。
类型“{}”不可分配给类型“void”。
子提取文本网页包插件:
chunk{0}提取文本网页包插件输出文件名3.32 kB[输入][呈现]
[0]./~/css-loader/lib/css-base.js 1.51 kB{0}[Build]
[1] ./~/css加载器/ClientApp/css/site.css 1.81 kB{0}[已构建]
如果我将浏览器指向任意位置以查看发生了什么,则会出现以下错误:

    ERROR in [at-loader] ./ClientApp/components/Layout.tsx:13:21 
        TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<NavMenu> & { children?: ReactNode; } & void'.
      Type '{}' is not assignable to type 'void'.
[at loader]中出现错误。/ClientApp/components/Layout.tsx:13:21 TS2322:类型“{}”不可分配给类型“IntrinsicatAttributes&IntrinsicClassAttributes&{children?:ReactNode;}&void”。 类型“{}”不可分配给类型“void”。
我在这里不知所措,因为所有这些例子都没有开箱即用。有什么帮助吗?

我有个小问题。尝试更新您的typescript版本和节点版本。在运行npm install-g之后,我又尝试了一次typescript@latest. 这次在执行dotnet CLI序列时出现了一些不同的错误。然后我在项目中打开了VS代码,并在VS代码的命令窗口中运行dotnet run。这一次,当我将浏览器指向时,项目成功了。我关闭并返回外部命令窗口,在那里运行dotnet run。现在把我的浏览器指向这里这一次也起了作用。我认为VS代码对bootstrap CLI框架进行了一些幕后清理。我想使用我正在工作的react应用程序,并将组件放入reactredux应用程序中。但是我得到一个错误,说“--allowJs”没有设置。这似乎是一个公认的问题,但到目前为止还没有解决方案。我想我已经完成了所有必要的步骤。我修改了tsconfig.json文件以包含“allowJs”:true。我添加了一个简单的Aboutjs测试组件,在导航栏中添加了一个菜单,修复了routes.tsx文件。但运行时失败:对节点模块的调用失败。。。。。。components\About.js意外标记(5:12)您可能需要适当的加载程序来处理此文件类型。现在怎么办?我有个笑脸。尝试更新您的typescript版本和节点版本。在运行npm install-g之后,我又尝试了一次typescript@latest. 这次在执行dotnet CLI序列时出现了一些不同的错误。然后我在项目中打开了VS代码,并在VS代码的命令窗口中运行dotnet run。这一次,当我将浏览器指向时,项目成功了。我关掉了电脑,回到了e