Ошибка Netlify: скрипт сборки вернул ненулевой код завершения: 254 - PullRequest
1 голос
/ 23 октября 2019

Спасибо за вашу помощь. У меня просто есть простой HTML-файл, который я хотел разместить через netlify. В моем git есть три файла: index.html, style.css и файл readme.

HTML-файл просто

<!DOCTYPE html>
    <head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">

    <link href="style.css" rel="stylesheet" type="text/css">
        <title>Company</title>
    </head>
    <body>
    <div>
         <h1> Coming Soon...</h1>
    </div>
    </body>
</html>

, а CSS-файл:

h1  {
       text-align: center;
       font-size: 20pt;
       color: #000099;
       margin-bottom: 5px;
    }

Ошибка, которую я получил:

10:45:42 PM: Executing user command: npm run build
10:45:43 PM: npm
10:45:43 PM: ERR!
10:45:43 PM:  code
10:45:43 PM:  ENOENT
10:45:43 PM: npm ERR!
10:45:43 PM:  syscall open
10:45:43 PM: npm ERR! path /opt/build/repo/package.json
10:45:43 PM: npm
10:45:43 PM:  ERR!
10:45:43 PM:  errno
10:45:43 PM:  -2
10:45:43 PM: npm
10:45:43 PM:  ERR! enoent ENOENT: no such file or directory, open '/opt/build/repo/package.json'
10:45:43 PM: npm ERR! enoent
10:45:43 PM:  This is related to npm not being able to find a file.
10:45:43 PM: npm ERR! enoent
10:45:43 PM: npm ERR!
10:45:43 PM:  A complete log of this run can be found in:
10:45:43 PM: npm ERR!     /opt/buildhome/.npm/_logs/2019-10-23T02_45_43_136Z-debug.log
10:45:43 PM: Skipping functions preparation step: no functions directory set
10:45:43 PM: Caching artifacts
10:45:43 PM: Started saving pip cache
10:45:43 PM: Finished saving pip cache
10:45:43 PM: Started saving emacs cask dependencies
10:45:43 PM: Finished saving emacs cask dependencies
10:45:43 PM: Started saving maven dependencies
10:45:43 PM: Finished saving maven dependencies
10:45:43 PM: Started saving boot dependencies
10:45:43 PM: Finished saving boot dependencies
10:45:43 PM: Started saving go dependencies
10:45:43 PM: Finished saving go dependencies
10:45:46 PM: Error running command: Build script returned non-zero exit code: 254
10:45:46 PM: Failing build: Failed to build site
10:45:46 PM: failed during stage 'building site': Build script returned non-zero exit code: 254
10:45:46 PM: Finished processing build request in 13.711952891s

1 Ответ

0 голосов
/ 23 октября 2019

Соответствующая часть:

ERR! enoent ENOENT: no such file or directory, open '/opt/build/repo/package.json'
npm ERR! enoent
This is related to npm not being able to find a file.

Обязательно создайте package.json сначала .
A npm init должно позаботиться об этом.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...