【发布时间】:2022-08-18 02:41:07
【问题描述】:
import * as tfn from \'@tensorflow/tfjs-node
向我抛出以下警告:
WARNING Compiled with 4 warnings 15:06:46
warning in ./node_modules/@tensorflow/tfjs-node/dist/index.js
Critical dependency: the request of a dependency is an expression
warning in ./node_modules/@mapbox/node-pre-gyp/lib/util/compile.js
Module not found: Error: Can\'t resolve \'node-gyp\' in \'C:\\Users\\Username\\Desktop\\Team\\my-app\\node_modules\\@mapbox\\node-pre-gyp\\lib\\util\'
warning in ./node_modules/@mapbox/node-pre-gyp/lib/util/compile.js
Module not found: Error: Can\'t resolve \'npm\' in \'C:\\Users\\Username\\Desktop\\Team\\my-app\\node_modules\\@mapbox\\node-pre-gyp\\lib\\util\'
warning in ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
这是为什么? (Vue:2.7.8)
Webpack.config.js:
const path = require(\'path\');
const nodeExternals = require(\'webpack-node-externals\');
module.exports = {
entry: \'./server.js\',
mode: \'production\',
target: \'node\',
externals: [nodeExternals()],
output: {
path: path.resolve(__dirname, \'.\'),
filename: \'server.bundle.js\'
}
};
软件包版本:
├── @tensorflow/tfjs-converter@3.19.0
├── @tensorflow/tfjs-core@3.19.0
├── @tensorflow/tfjs-node@3.19.0
├── @tensorflow/tfjs@3.19.0
├── aws-sdk@2.1195.0
(如果您需要更多详细信息,请告诉我)
标签: vuejs2 tensorflow.js