NodeJS error Command failed with signal“SIGABRT”当运行npm run sass-lint时

ghhkc1vu  于 2023-10-17  发布在  Node.js
关注(0)|答案(2)|浏览(463)

因此,我安装了scss-lint与Atom和npm -g sass-lint
当我运行npm run sass-lint时,我得到这个奇怪的错误消息:
我试图在终端中运行scss-lint,但是找不到有关该命令的文档。

yarn run v1.0.2
$ "/Users/leongaban/projects/mythor/node_modules/.bin/sass-lint"

<--- Last few GCs --->

   12182 ms: Mark-sweep 1386.7 (1429.9) -> 1386.7 (1435.9) MB, 1461.1 / 0.0 ms (+ 0.1 ms in 162 steps since start of marking, biggest step 0.0 ms) [allocation failure] [scavenge might not succeed].
   13882 ms: Mark-sweep 1392.3 (1435.9) -> 1392.3 (1435.9) MB, 1698.0 / 0.0 ms (+ 0.1 ms in 90 steps since start of marking, biggest step 0.0 ms) [allocation failure] [scavenge might not succeed].

<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: MarkCompactCollector: semi-space copy, fallback in old gen Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 4: v8::internal::MarkCompactCollector::EvacuateNewSpaceVisitor::AllocateTargetObject(v8::internal::HeapObject*, v8::internal::HeapObject**) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 5: v8::internal::MarkCompactCollector::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject*) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 6: v8::internal::MarkCompactCollector::VisitLiveObjects(v8::internal::MemoryChunk*, v8::internal::MarkCompactCollector::HeapObjectVisitor*, v8::internal::MarkCompactCollector::IterationMode) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 7: v8::internal::MarkCompactCollector::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 8: v8::internal::PageParallelJob<v8::internal::EvacuationJobTraits>::Task::RunInternal() [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
 9: v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
10: v8::internal::MarkCompactCollector::EvacuateNewSpaceAndCandidates() [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
11: v8::internal::MarkCompactCollector::CollectGarbage() [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
12: v8::internal::Heap::MarkCompact() [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
13: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
14: v8::internal::Heap::CollectGarbage(v8::internal::GarbageCollector, char const*, char const*, v8::GCCallbackFlags) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
15: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
16: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/leongaban/.nvm/versions/node/v6.11.0/bin/node]
17: 0x19d1ab079a7
18: 0x19d1b117952
19: 0x19d1b175ae6
error Command failed with signal "SIGABRT".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
7rfyedvj

7rfyedvj1#

你可以尝试在运行服务器时增加Node.js内存,如下所示:

package.json ...

{
  "scripts": {
     "sass-lint": "node --max-old-space-size=4096 ./node_modules/.bin/sass-lint"
  },
}
dpiehjr4

dpiehjr42#

把它弄出来,需要这个:
"test-scsslint": "./node_modules/.bin/sass-lint 'client/styles/**/*.scss' -v -q",

相关问题