我尝试创建后端 API 的 docker 映像。但出现错误。我用谷歌搜索了一下,遇到同样问题的每个人都必须在 .dockerignore 文件中添加 node_module 。
我已经这样做了,但是仍然有同样的错误。
我在这里添加我的文件信息。
Dockerfile
FROM node:alpine
WORKDIR /usr/src/app
COPY package*.json .
#COPY yarn.lock .
RUN apk add --no-cache yarn --repository="http://dl-cdn.alpinelinux.org/alpine/edge/community"
#RUN yarn install --frozen-lockfile
RUN yarn install
RUN yarn
COPY . .
CMD ["yarn", "dev"];
Run Code Online (Sandbox Code Playgroud)
.dockerignore
/node_modules
.env
docker-compose.yml
Run Code Online (Sandbox Code Playgroud)
docker-compose.yml
version: "3.9"
services:
mongo_db:
container_name: mongodb_container
image: mongo:latest
restart: always
ports:
- "27017:27017"
volumes:
- mongo_db:/data/db
#EET service
eetapi:
container_name: eetapi_container
build: .
volumes:
- .:/usr/src/app
ports:
- "3000:3000"
environment:
SITE_URL: http://localhost …Run Code Online (Sandbox Code Playgroud) 我正在处理该项目,没有问题..突然,当我将模板粘贴到另一个组件中时。该组件无法识别有角材料的元素。然后整个项目停止识别角度材料选择器。现在我有节点模块错误。
我已经尝试过了npm install,npm audit fix --force但仍然是同样的错误。我应该怎么办?
我刚刚通过按照官方文档npm init vue@latest中指定的方式运行来创建一个新的 Vue 应用程序。然后我尝试按照Vue 和 Vite网站上的指南将 Tailwind 添加到我的应用程序中。然而,当打开文件时,我注意到 ESLint 告诉我没有定义并且语法不起作用。tailwind.config.jsmodulemodule.exports
这是为什么?我该如何解决它?
.eslintrc.cjs编辑: Vue 创建的默认文件如下所示:
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
root: true,
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-prettier",
],
parserOptions: {
ecmaVersion: "latest",
},
};
Run Code Online (Sandbox Code Playgroud) /Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/bindings/bindings.js:121\n throw e;\n ^\n\nError: The module \'/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/better-sqlite3/build/Release/better_sqlite3.node\'\nwas compiled against a different Node.js version using\nNODE_MODULE_VERSION 93. This version of Node.js requires\nNODE_MODULE_VERSION 108. Please try re-compiling or re-installing\nthe module (for instance, using `npm rebuild` or `npm install`).\n at Module._extensions..node (node:internal/modules/cjs/loader:1203:18)\n at Module.load (node:internal/modules/cjs/loader:997:32)\n at Module._load (node:internal/modules/cjs/loader:838:12)\n at Module.require (node:internal/modules/cjs/loader:1021:19)\n at require (node:internal/modules/cjs/helpers:103:18)\n at bindings (/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/bindings/bindings.js:112:48)\n at new Database (/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/better-sqlite3/lib/database.js:48:64)\n at Database (/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/better-sqlite3/lib/database.js:11:10)\n at new SqliteDriver (/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/quick.db/out/drivers/SqliteDriver.js:8:25)\n at new QuickDB (/Users/dhyan/Downloads/Dhyan99-bot-v14 (4)/node_modules/quick.db/out/index.js:17:28) {\n code: \'ERR_DLOPEN_FAILED\'\n}\n\nNode.js v18.8.0\nRun Code Online (Sandbox Code Playgroud)\n … 作为更大用例的单元测试,我正在检查我在前端执行的 pedersen 哈希确实与通过 circom 电路完成的预期哈希一致。我在电路中使用一个简单的断言并生成一个见证,并将散列值和未散列值提供给电路,重新创建散列以确保它通过。
我正在使用 circomlibjs 在前端运行 Pedersen 哈希。作为单元测试,我有。一个带有简单断言的电路,用于检查前端的结果是否与 circom 电路中的 pedersen 哈希值一致。
我正在使用的电路:
include "../node_modules/circomlib/circuits/bitify.circom";
include "../node_modules/circomlib/circuits/pedersen.circom";
template check() {
signal input unhashed;
signal input hashed;
signal output createdHash[2];
component hasher = Pedersen(256);
component unhashedBits = Num2Bits(256);
unhashedBits.in <== unhashed;
for (var i = 0; i < 256; i++){
hasher.in[i] <== unhashedBits.out[i];
}
createdHash[0] <== hasher.out[0];
createdHash[1] <== hasher.out[1];
hashed === createdHash[1];
}
component main = check();
Run Code Online (Sandbox Code Playgroud)
在前端,我正在运行以下命令,
import { buildPedersenHash } from 'circomlibjs';
export function buff2hex(buff) { …Run Code Online (Sandbox Code Playgroud) 我使用的是 Apple M1 Max 处理器和 MAC os Ventura 13.0。
我使用的是 Node v18.12.1 (npm v8.19.2)
使用后
gatsby new
Run Code Online (Sandbox Code Playgroud)
并设置站点,将其安装到 Gatsby 4,并 React 到 18.1.0 并运行以下命令后:
npm install gatsby@next --legacy-peers-deps
Run Code Online (Sandbox Code Playgroud)
我在 package.json 文件中看到 Gatsby 现在设置为:5.0.0-next.16。
然后运行命令:
nvm install 18
Run Code Online (Sandbox Code Playgroud)
然后我运行命令:
npm run develop
Run Code Online (Sandbox Code Playgroud)
但后来我遇到了以下错误:
缺少调用“building-schema”的onError处理程序,错误为“错误:无法将以下值创建为TypeComposer:
GraphQLScalarType({名称:“日期”,描述:“日期字符串,例如2007-12-03,符合使用公历表示日期和时间的 ISO 8601 标准。",specifiedByURL:未定义,serialize:[函数字符串],parseValue:[函数字符串],parseLiteral:[函数 parseLiteral],扩展名:{ },astNode:未定义,扩展 ASTNodes:[] })。'。Stacktrace 为“错误:无法创建以下值作为 TypeComposer:
GraphQLScalarType({ name: "Date", description: "日期字符串,例如 2007-12-03,符合 ISO 8601 标准,用于表示日期和时间公历。”,specifiedByURL:未定义,序列化:[函数字符串],parseValue:[函数字符串],parseLiteral:[函数parseLiteral],扩展名:{},astNode:未定义,扩展ASTNodes:[]})。
这是苹果芯片的问题还是我遗漏了什么?
我面临这三个问题,我仍然不明白你的错误在哪里。
\n错误:找不到模块:错误:无法解析“C:\\Users\\DexSh\”中的“C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource” \desktop\\C# Angular\\Testing'
\n错误:找不到模块:错误:无法解析 'C:\\Users\\DexSh\\desktop\\C# Angular\\Testing\\node_modules\\webpack-dev-server\\client\\index.js?协议=auto%3A&用户名=&密码=&主机名=0.0.0.0&端口=0&路径名=%2Fng-cli-ws&logging=信息&覆盖=%7B%22errors%22%3Atrue%2C%22warnings%22%3Afalse%7D&reconnect=10&hot=false&live-reload =true' in 'C:\\Users\\DexSh\\desktop\\C# Angular\\Testing'
\n错误:加载程序“C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css”未返回字符串。
\n当使用 ng build 返回这个
\n\nWarning: \xe2\x96\xb2 [WARNING] Comments in CSS use "/* ... */" instead of "//" [js-comment-in-css]\n\n C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:18:\n 1 \xe2\x94\x82 /******/ (() => { // webpackBootstrap\n \xe2\x95\xb5 ~~\n\n\n\nWarning: \xe2\x96\xb2 [WARNING] Unexpected "(" [css-syntax-error]\n\n C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:9:\n 1 \xe2\x94\x82 /******/ (() => { // webpackBootstrap\n \xe2\x95\xb5 ^\n\n\n\n\n\nError: Module not found: Error: Can't resolve 'C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource' in 'C:\\Users\\DexSh\\desktop\\C# Angular\\Testing'\n\nError: The loader "C:/Users/DexSh/desktop/C# …Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用 TypeScript。如果我尝试使用 commonJS 导入包
\nconst { v4: uuidv4 } = require(\'uuid\');\nRun Code Online (Sandbox Code Playgroud)\n然后我在编译期间不会收到任何错误,但是当我将其转换为 ES6 模块时,例如
\nimport { v4 as uuidv4 } from \'uuid\'; \nRun Code Online (Sandbox Code Playgroud)\n我收到如下编译错误:
\n\n\n找不到模块“uuid”的声明文件。\'C:/Users/project/dependencies/nodejs/node_modules/uuid/dist/index.js\' 隐式具有 \'any\' 类型。尝试\'npm i --save-dev @types/uuid\'(如果存在)或添加包含\'声明模块\'uuid\'的新声明(.d.ts)文件;
\n
我已经安装了@types/uuid。
\n我确实遇到了需要类型定义(@types/*)的包的问题
\n如果项目结构类似于下面的示例:
\nconst { v4: uuidv4 } = require(\'uuid\');\nRun Code Online (Sandbox Code Playgroud)\n要重新生成此问题,请运行下面提到的命令:
\nimport { v4 as uuidv4 } from \'uuid\'; \nRun Code Online (Sandbox Code Playgroud)\n将以下 json 添加到 tsconfig.json 文件:
\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependencies\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 nodejs\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json\n\xe2\x94\x82\xc2\xa0 \xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 node_modules\n\xe2\x94\x82\xc2\xa0 …Run Code Online (Sandbox Code Playgroud) 您好,我正在尝试在终端上执行 npx create-react-app myapp,但它开始执行,但总是挂起在随机节点模块上,但操作可以通过 ctrl c 终止,但主要问题是当我尝试安装同一节点时它挂起的模块可以成功单独安装,但是当尝试再次运行 cra 时,它挂在另一个节点模块上,我也有最新的 npm 版本 8 和 9,并且还有节点 18 和 19......而且我有安装了 5.0.10 的 create-react-app 版本 请帮助我 我陷入了这个困境... Cra 正在创建我认为的主要错误
以下是一些相关问题:
\n使用yarn工作空间时,如何强制将包安装在相关的node_modules中?
\n\n我是否应该对带有react-native-web的monorepo中的所有包使用no-hoist?
\n我正在使用 npm 工作区来组织多个包。问题是我的主包在本地 node_modules 中没有其依赖项(也是工作区之一)源代码。我知道依赖项安装在根 node_modules 中,问题是我需要通过主包的相对路径访问它。
\nnpm install这是在根目录下运行后的项目结构:
root\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json -> { "workspaces": ["packages/*"] }\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 node_modules\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependency-A\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependency-B\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 packages\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 main-package\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependency-A\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 dependency-B\nRun Code Online (Sandbox Code Playgroud)\n根目录中的package.json:
\nroot\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 package.json -> { "workspaces": ["packages/*"] }\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 node_modules\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependency-A\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependency-B\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 packages\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 main-package\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependency-A\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 dependency-B\nRun Code Online (Sandbox Code Playgroud)\n“packages/main-package”中的 package.json:
\n{\n "workspaces": [\n "packages/main-package",\n "packages/dependency-A",\n "packages/dependency-B"\n ]\n}\n\nRun Code Online (Sandbox Code Playgroud)\nwebpack.config.js 在“packages/main-package”中: …
node-modules ×10
node.js ×4
npm ×3
angular ×2
bcrypt ×1
circom ×1
circuit ×1
docker ×1
hash ×1
monorepo ×1
npm-install ×1
quick.db ×1
reactjs ×1
tailwind-css ×1
tsconfig ×1
typescript ×1
vue.js ×1
zk-snark ×1